VMware ESXi hosts run a Syslog service (vmsyslogd
) that provides a standard mechanism for logging messages from the VMkernel and other system components. By default in ESXi, these logs are placed on a local scratch volume or a ramdisk. To preserve the logs further, ESXi can be configured to place these logs to an alternate storage location on disk and to send the logs across the network to a Syslog server.
Retention, rotation, and splitting of logs received and managed by a Syslog server are fully controlled by that Syslog server. ESXi cannot configure or control log management on a remote Syslog server. For more information, see the documentation for the Syslog server.
VMware ESXi 6.x
VMware ESXi 7.x
VMware ESXi 8.x
There are five configurable options:
Syslog.global.logDir
- Location on a local or remote datastore (VMFS, NFS, FAT) and path where logs should be saved to. Has the format [DatastoreName] DirectoryName
which maps to /vmfs/volumes/DatastoreName/DirectoryName/
.
/scratch
is defined, the default is []/scratch/log
. For more information on scratch, see Creating a persistent scratch location for ESXi 8.x/7.x/6.xSyslog.global.logHost
- Comma-delimited list of remote servers where logs are sent using the syslog protocol. If the logHost
field is blank, no logs are forwarded. Include the protocol and port, similar to tcp://hostname:514
or udp://hostname:514
or ssl://hostname:1514
.Syslog.global.logDirUnique
- A boolean option which controls whether a host-specific directory is created within the configured logDir
. The directory name is the hostname of the ESXi host. A unique directory is useful if the same shared directory is used by multiple ESXi hosts. Defaults to false
.Syslog.global.defaultRotate
- The maximum number of log files to keep locally on the ESXi host in the configured logDir. Does not affect remote syslog server retention. Defaults to 8
.Syslog.global.defaultSize
- The maximum size, in kilobytes, of each local log file before it is rotated. Does not affect remote syslog server retention. Defaults to 1024 KB
. For more information on sizing, see Providing Sufficient Space for System Logging.esxcli
commandLocal and Remote syslog functionality can be configured for a host using the esxcli
command line utility, which can be used at the console of an ESXi host, in the vCLI, or in the vMA.
esxcli
command is available, such as the vCLI or on the ESXi host directly.esxcli system syslog config get
esxcli system syslog config set --logdir=/path/to/vmfs/directory/ --loghost=RemoteHostname --logdir-unique=true|false --default-rotate=NNN --default-size=NNN
esxcli system syslog config set --loghost='tcp://10.11.12.13:514'
esxcli system syslog reload
nc -z RemoteHostname 514
nc -z 10.11.12.13 514
Local and Remote syslog functionality can be configured for a cluster of similar hosts using Host Profiles. For more information, see the Set Up Syslog from the Host Profiles Interface document
esxcli
or advanced configuration options and captured this as a reference host, the 5 configuration options are already visible under the Advanced Configuration option section.
Local and Remote syslog functionality can be configured for a host using advanced configuration options, which can be set using the vSphere Client, vSphere Web Client, PowerCLI, or vCLI.
This configuration cannot be performed using the local console's esxcfg-advcfg
command. For more information on setting advanced configuration options using each method, see Configuring advanced options for ESXi/ESX.
Note: If the ESXi host loses communication with the remote syslog server, logging Logging stops being pushed to the syslog server. You see the "failed to write log
" error in the /var/log/.vmsyslogd.err
file. Nothing is sent to the remote syslog server until the syslogd
service is restarted.
esxcli
command/syslog port:To open outbound traffic through the ESXi Firewall on UDP port 514 and TCP ports 514 and 1514, run these commands:
Additionally, you can review Port requirements for ESXi Port requirements for ESXi.
esxcli network firewall ruleset set --ruleset-id=syslog --enabled=true
esxcli network firewall refresh