log rotation | Nutanix Community
Skip to main content

I checked the log rotation interval for CVM and Prism Central in the manual, but I couldn't find any information.

With the default settings, how often are logs rotated, and how many generations of data are retained?

Most logfiles use Scavenger. Scavenger process on each CVM is responsible for keeping the disk utilization by log files in check. It will rotate out old logs when the disk utilization for the given log directory hits the default threshold. The threshold for each type of directory is given below:

  • /home/nutanix/data/cores - 2GiB
  • /home/nutanix/data/logs - 9GiB
  • /home/nutanix/data/binary_logs - 1GiB

These thresholds can be tuned by support

Scavenger logic

  • Frequent scans: Scavenger scan runs every two minutes and checks the contents of the tree directories above.
  • Component-oriented: In each directory the scan operates with a component i.e. zookeeper_monitor, health_server, prism_monitor, etc.
  • Compacting files: The scan disregards currently active files that are being appended to (zookeeper.out or prism.out, for example) and merges the second oldest file to the oldest file until the file grows to 100MB in size.
  • Compressing the files: The scan leaves out 3 uncompressed files (in addition to the currently active file) and compresses the rest of files into a ZIP format.
  • Clean up: The size of the files and directories is accessed. If the size of the directory reaches the threshold 2048 (core), 9216 (logs), 1024 (binary logs) Scavenger bins the oldest file that is older than 7 days from the largest sized component and repeats the task until the directory size is below the threshold again.

Thank you for your reply.