Information
Configure the Syslog.global.logDir parameter to specify a persistent directory for system logs, ensuring they are retained across reboots. This can be set to a directory on mounted NFS or VMFS volumes, other than the default which is an in-memory filesystem that retains only a single day's worth of logs.
Storing logs persistently is crucial for auditing, monitoring events, and diagnosing issues. Without persistent logging, critical indicators of compromise and user activity logs are lost at each reboot, which can hinder incident response and forensic investigations.
Solution
To configure persistent logging properly, perform the following from the vSphere web client:
- Select the host
- Click Configure then expand System then select Advanced System Settings
- Select Edit then enter Syslog.global.LogDir in the filter.
- Set Syslog.global.logDir to a persistent location specified as [datastorename] path_to_file where the path is relative to the datastore. For example, [datastore1] /systemlogs.
- Click OK
Alternatively, run the following PowerCLI command:
# Set Syslog.global.logDir for each host
Get-VMHost | Foreach { Set-AdvancedConfiguration -VMHost $_ -Name Syslog.global.logDir -Value "<NewLocation>" }
Impact:
There is no specified functional impact, however, consideration should be given to storage capacity as increased log retention will require more storage space. If the only local, non-vSAN storage is unreliable SD or USB media, configuring a remote logging host is advised.