6.5

Table Of Contents
n
Log rotation policies - Sets maximum log size and the number of archives to keep. You can specify
policies both globally, and for individual subloggers. For example, you can set a larger size limit for the
vmkernel log.
I The esxcli system syslog command is the only supported command for changing ESXi 5.0
and later logging conguration. The vicfg-syslog command and editing conguration les is not supported
for ESXi 5.0 and can result in errors.
After making conguration changes, restart the vmsyslogd syslog service by running esxcli system syslog
reload.
The esxcli system syslog command allows you to congure the logging behavior of your ESXi system.
With vSphere 5.0, you can manage the top-level logger and subloggers. The command has the following
options.
Option Description
mark
Marks all logs with the specied string.
reload
Reloads the conguration, and updates any changed conguration values.
config get
Retrieves the current conguration.
config set
Sets the conguration. Use one of the following options.
n
--logdir=<path> – Saves logs to a given path.
n
--loghost=<host> – Sends logs to a given host.
n
--logdir-unique=<true|false>Species whether the log should go to a unique
subdirectory of the directory specied in logdir.
n
--default-rotate=<int> – Default number of log rotations to keep.
n
--default-size=<int> – Size before rotating logs, in KB.
config logger list
Shows currently congured subloggers.
config logger set
Sets conguration options for a specic sublogger. Use one of the following options.
n
--id=<str> – ID of the logger to congure. Required.
n
--reset=<str> – Resets values to default.
n
--rotate=<long> – Number of rotated logs to keep for a specic logger. Requires --id.
n
--size=<long> – Size of logs before rotation for a specic logger, in KB. Requires --id.
Example: esxcli system syslog Usage
The following workow illustrates how you might use esxcli system syslog for log conguration. Specify
one of the options listed in “Connection Options for vCLI Host Management Commands,” on page 19 in
place of <conn_options>.
1 Show conguration options.
esxcli <conn_options> system syslog config get
Default Rotation Size: 1024
Default Rotations: 8
Log Output: /scratch/log
Logto Unique Subdirectory: false
Remote Host: <none>
2 Set all logs to keep twenty rotations before overwriting the oldest log.
esxcli <conn_options> system syslog config set --default-rotate=20
3 Set the rotation policy for VMkernel logs to 10 rotations, rotating at 2 MB.
esxcli <conn_options> system syslog config logger --id=vmkernel --size=2048 --rotate=10
Chapter 10 Monitoring ESXi Hosts
VMware, Inc. 165