Send VMware ESXi logs to a syslog server
When to use this: You want ESXi host logs stored centrally instead of on the host's small local log area.
Before you start
Steps
-
See the current settings
terminalesxcli system syslog config getShows the current
Remote Hostand local log settings. -
Set the remote log host
terminalesxcli system syslog config set --loghost='udp://192.168.1.10:514' esxcli system syslog reloadUse
tcp://instead ofudp://for reliable delivery, orssl://for TLS where supported. Reload applies the change. -
Open the ESXi firewall for syslog
terminalesxcli network firewall ruleset set --ruleset-id=syslog --enabled=true esxcli network firewall refreshRequired even for the standard ports: the syslog ruleset is not always enabled by default.
-
Send a test message
terminalesxcli system syslog mark --message="Syslog test from ESXi"Writes a marker line that should arrive at the server.
-
Check reachability (optional)
terminalnc -z 192.168.1.10 514Tests the TCP port from the host. UDP cannot be proven this way, so also check on the server.
Commands follow the Broadcom/VMware knowledge-base article “Configuring syslog on ESXi”. Check it for your ESXi version.
How to verify it worked
- The test marker appears in
/var/log/remote/<esxi-ip>/<today>.logon the server.
How to undo it
Remove the remote host:
esxcli system syslog config set --reset=loghost
esxcli system syslog reloadCommon errors and fixes
tcpdump on the server. esxcli system syslog reload) and consider UDP or a stable server. Q&A
Which command sets the remote syslog target on ESXi?
esxcli system syslog config set --loghost='tcp://<ip>:514', then esxcli system syslog reload.
Why do I need to open the firewall on ESXi?
ESXi has its own firewall, and the syslog ruleset must be enabled for outgoing syslog even on standard ports.