[Internal] Modifying the VMsyslogd configuration files to change the default log rotation and size within ESXi
search cancel

[Internal] Modifying the VMsyslogd configuration files to change the default log rotation and size within ESXi

book

Article ID: 313936

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article to modify the default log rotation and size of log files generated by the VMsyslogd service within vSphere ESXi.

Environment

VMware vSphere ESXi 7.0

Resolution

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).
 



Additional Information

[Internal] Understanding and troubleshooting the syslog or syslog-ng services in vSphere 5.x (1031674)

[Internal] Understanding and troubleshooting the syslog or syslog-ng services in vSphere 5.x
Configuring syslog on ESXi

Impact/Risks:
  • To make this configuration changes persistent between reboots run "auto-backup.sh" script.
  • Increasing the number of log files or the log file size could increase the amount of disk spaced used for logging. Make sure to have sufficient disk space before applying these changes.