Information
Normally a new log file is created only when a host is rebooted, so the file can grow to
be quite large. You can ensure that new log files are created more frequently by limiting the
maximum size of the log files. If you want to restrict the total size of logging data, VMware
recommends saving 10 log files, each one limited to 1 MB. Each time an entry is written to
the log, the size of the log is checked; if it is over the limit, the next entry is written to a new
log. If the maximum number of log files already exists, when a new one is created, the
oldest log file is deleted.
*Rationale*
Log files should be rotated to preserve log data in case of corruption or destruction of the
current log file, and to avoid the likelihood of logging issues caused by an overly large log file.
Solution
To set the number of log files to be used to 10, run the following PowerCLI command:
# Add the setting to all VMs
Get-VM | New-AdvancedSetting -Name 'log.keepOld' -value '10'