The VMsyslogd service runs on the vSphere ESXi host and determines the log rotation and size for each service running on the host. This service is one of the first services to initialize during boot.
VMsyslogd consists of two configurations locations:
- /etc/vmsyslogd.conf
This file determined the default log rotations and files size for each service running on vSphere ESXi. Below is an example of vmsyslog.conf:
[DEFAULT]
loghost = <none>
default_timeout = 180
logdir_unique = false
rotate = 8
logdir = <none>
size = 1024
By default, the log file size is 1 MB as indicated by size=1024 (size in KB) and will maintain 8 log files within the rotation process as defined by rotate = 8.
- /etc/vmsyslog.conf.d/servicename.conf
The folder /etc/vmsyslog.conf.d contains multiple files for each service on vSphere ESXi. These are unique files for each service in which you may specify values to override the default values defined in /etc/vmsyslogs.conf.
Below is an example of hostd.conf:
[vmsyslog-logger]
fclass = FileLoggerMessageOnly
rotate = 10
descr = Hostd logs
idents = Hostd
nclass = NetworkFilterHostdTimestamp
onrotate = logger -t Hostd < /var/run/vmware/hostdLogHeader.txt
file = hostd
id = hostd
size = 10240
Using a text editor, you can make changes to these files and save your changes. These changes will not take effect until executing the following command on the host:
esxcli system syslog reload
Important: Modifying the VMsyslogd configuration files without a backup could cause system instability. For best practice, VMsyslogd parameter should be modified according to
Configuring syslog on ESXi 5.x (2003322).