Configuring log rotation of syslog collector in the vCenter Server Appliance
search cancel

Configuring log rotation of syslog collector in the vCenter Server Appliance

book

Article ID: 338197

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

This article provides steps for modifying the Syslog Collector settings on VMware vCenter Server Appliance.

Environment

VMware vCenter Server Appliance 6.0.x

Resolution

To modify the VMware Syslog Collector configuration in the vCenter Server Appliance:

Note: Currently, there is no method in Web Client to configure the log rotation of the syslog collector on the vCenter Server Appliance.

  1. Log in to the vCenter Server Appliance as the root user.
  2. Take a backup of the /etc/vmware-syslog/custom-file-location.conf file by running the command:

    cp /etc/vmware-syslog/custom-file-location.conf /etc/vmware-syslog/custom-file-location.conf.bak

  3. Open the custom-file-location.conf file using a text editor, such as vi.
  4. Locate this entry:

    $template esx,"/var/log/vmware/esx/ %hostname% 10485760/50 %timestamp:::date-rfc3339% %syslogseverity-text% %hostname% %programname% %msg%"

    Where:
    10485760
    is the size of the syslog file in bytes and 50 is the number of files to retain.

  5. To set size to 5MB and number of logs to 10, modify the entry to:

    $template esx,"/var/log/vmware/esx/ %hostname% 5242880/10 %timestamp:::date-rfc3339% %syslogseverity-text% %hostname% %programname% %msg%"

  6. Restart the syslog collect service by running the command:

    service-control --stop vmware-syslog

    service-control --start vmware-syslog






Additional Information


How to stop, start, or restart vCenter Server 6.x services
在 vCenter Server Appliance 中配置 Syslog Collector 的日志轮换