Increasing VMware vCenter Server and VMware ESXi logging levels
search cancel

Increasing VMware vCenter Server and VMware ESXi logging levels

book

Article ID: 316627

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article provides steps to increase the size and number of the hostd, vpxa, and vpxd logs so that additional data is saved. This data may be useful for troubleshooting purposes.

The Management agent (hostd), VirtualCenter Agent Service (vpxa), and VirtualCenter (vpxd) logs are automatically rotated and maintained to manage their growth. Information in the logs can be lost if the logs are rotated too quickly.

Note: Rotation means the turn over of files. For example, if you set the maximum number of log files to 10, after every 10 log files, the numbering restarts at 0.

Each set of logs are found at these locations:
  • hostd and vpxa log location: /var/log/
  • vpxd logs on a vCSA/vCenter Appliance: /var/log/vmware


Environment

VMware vSphere ESXi 6.0
VMware vSphere ESXi 6.5
VMware vSphere ESXi 7.0.0
VMware vCenter Server 6.0.x
VMware vCenter Server 6.5.x
VMware vCenter Server 6.7.x
VMware vCenter Server 7.0.x
VMware vCenter Server 8.0.x

Resolution

Caution: Enabling trivia or verbose logging for a longer duration might cause performance degradation on vCenter Server. Only enable trivia or verbose logging for troubleshooting purposes. VMware recommends reverting to default logging (info level) immediately after the troubleshooting is complete. VMware does not recommend enabling trivia/verbose logging in a production environment. Perform the steps in this article only after consulting VMware technical support.

Before you increase the size and number of logs: Caution: VMware does not recommend decreasing the number or size of logs from the default settings.

This article contains three sections:
  • hostd
  • vpxa
  • vpxd

hostd

To increase hostd logging from the vCenter Server vSphere Client. Note: The default logging level for config.HostAgent.log.level is info for ESXi 6.x and 7.x.
  1. Using the vSphere Client, connect to the vCenter Server.
  2. Click the ESXi host, then click Configure.
  3. Under System, click Advanced System Settings.
  4. In the Advanced Settings view, click Edit in the top right.
  5. In the Key column, filter for config.HostAgent.log.level.
  6. In the Value column, set the preferred logging level. For information on the different logging levels, see the #AdditionalInformationsection.
  7. Click OK to save.
To increase hostd logging from the command line.
  1. Log in to your host as root from either an SSH session or directly from the console.
  2. Open the configuration file for hostd using a text editor.

    Note: The configuration file for hostd is found at /etc/vmware/hostd/config.xml.

    ESXi 6.x: To redirect logs to the local disk instead of syslog for troubleshooting purposes, first change this line in the config.xml file (located at /etc/vmware/hostd/config.xml) to true.

    <outputToFiles>false</outputToFiles>

    The file looks similar to:

    <config>
    :
    <log>
    <directory>/var/log/vmware/</directory>
    <level>verbose</level>
    <name>hostd</name>
    <outputToConsole>false</outputToConsole>
    <maxFileSize>52428800</maxFileSize>
    <maxFileNum>50</maxFileNum>
    </log>
    :
    </config>


    Description of each entry:
    • <directory>/var/log/vmware/</directory>
      • Logging path
      • Note: The <directory> entry can also be updated with a full path to a VMFS datastore. This may be useful on ESXi hosts where space is limited. For example:
        <directory>/vmfs/volumes/<datastore name>/<log directory></directory>
    • <level>info</level>
      • Logging level
    • <name>hostd</name>
      • Prefix
    • <outputToConsole>false</outputToConsole>
      • Console out
    • <maxFileSize>5242880</maxFileSize>
      • Maximum size of each log file in bytes
      • Increase the <maxFileSize> parameter to change the maximum size of the logs.
    • <maxFileNum>50</maxFileNum>
      • Maximum number of log files
      • Increase the <maxFileNum> parameter to change the maximum number of logs.
  3. Restart the hostd management agent for the change to take effect. For more information, see Restarting the Management agents on an ESXi or ESX host (1003490).

Note: In 6.x, hostd log output is set by default to output to syslog. In this case, the advanced settings Syslog.loggers.hostd.rotate and Syslog.loggers.hostd.size takes precedence over the settings on the /etc/vmware/hostd/config.xml file.

To change the settings:
  1. Connect to the vCenter Server vSphere Client.
  2. Click on the ESXi host.
  3. Navigate to Configure > System >  Advanced System Settings.
  4. Click Edit in the top right.
  5. In the Key column, filter for Syslog.loggers.hostd.rotate and Syslog.loggers.hostd.size.
  6. In the Value column, adjust the setting.
  7. Click OK to save.

ESXi 7.0U2 and higher: 

Starting in ESXi 7.0U2, changes to the logging level for hostd have changed and are accessible by running the tool /bin/configstorecli per How to change configuration settings for Hostd service in vSphere ESXi 7.0 Update 2 (82227)

vpxa

To increase vpxa logging from the vCenter Server vSphere Client. Note: The default logging level for config.HostAgent.log.level is info for ESXi 6.x and 7.x.
  1. Using the vSphere Client, connect to the vCenter Server.
  2. Click the ESXi host, then click Configure.
  3. Under System, click Advanced System Settings.
  4. In the Advanced Settings view, click Edit in the top right.
  5. In the Key column, filter for Vpx.Vpxa.config.log.level.
  6. In the Value column, set the preferred logging level. For information on the different logging levels, see the #AdditionalInformationsection.
  7. Click OK to save.

To increase vpxa logging from the command line.

  1. Log in to your host as root from either an SSH session or directly from the console.
  2. Open the configuration file for vpxa in a text editor.

    Note: For ESXi 6.x, the vpxa.cfg file is located at /etc/vmware/vpxa

    The file looks similar to:

    <config>
    :
    <log>
    :
    <maxFileNum>50</maxFileNum>
    <maxFileSize>5242880</maxFileSize>
    <level>verbose</level>
    </log>
    :
    </config>


    Description of each entry:
  • <directory>/var/log/vmware/</directory>
    • Logging path
    • Note: The <directory> entry can also be updated with a full path to a VMFS datastore. This may be useful on ESXi hosts where space is limited. For example:
      <directory>/vmfs/volumes/<datastore name>/<log directory></directory>
  • <level>info</level>
    • Logging level
  • <maxFileSize>5242880</maxFileSize>
    • Maximum size of each log file in bytes. By default, the maximum file size is 5243904 bytes.
    • Increase the <maxFileSize> parameter to change the maximum size of the logs.
  • <maxFileNum>50</maxFileNum>  
    • Maximum number of log files
    • Increase the <maxFileNum> parameter to change the maximum number of logs.

ESXi 7.0U3 and higher: 

For ESXi 7.0 U3 and later, changes to the logging level for vpxa have changed and are accessible using the tool /bin/configstorecli, see vSphere ESXi 7.0 U3 VPXA configuration properties (87438)

  1. Restart the hostd management agent for the change to take effect. For more information, see Restarting the Management agents on an ESXi or ESX host (1003490).

Note: In 6.x/7.x, vpxa log output is set by default to output to syslog. In that case, the advanced settings Syslog.loggers.vpxa.rotate and Syslog.loggers.vpxa.size takes precedence over the settings on the vpxa.cfg file.

To change the settings:
  1. Connect to the vCenter Server vSphere Client.
  2. Click on the ESXi host.
  3. Navigate to Configure > System >  Advanced System Settings.
  4. Click Edit in the top right.
  5. In the Key column, filter for Syslog.loggers.vpxa.rotate and Syslog.loggers.vpxa.size.
  6. In the Value column, adjust the setting.
  7. Click OK to save.

vpxd

To increase vpxd logging from the vCenter Server vSphere Client.
  1. Using the vSphere Client, connect to the vCenter Server.
  2. Select vCenter Server, for which you need to increase the logging level.
  3. Go to Configure > SettingsGeneral.
  4. Click Edit for vCenter Server Settings.
  5. Select Logging options.
  6. Select the preferable logging option from the dropdown under Log Level. For information on the different logging levels, see the #AdditionalInformationsection .

If vCenter Server does not start, you must enable trivia logging manually.

To manually enable trivia logging:
  1. Log into vCenter Server as an administrator.
  2. Edit the vpxd.cfg file located in /etc/vmware-vpx/vpxd.cfg.

    The file looks similar to:

    <log>
        <compressOnRoll>true</compressOnRoll>
        <level>info</level>
        <maxFileNum>30</maxFileNum>
        <maxFileSize>52428800</maxFileSize>
        <outputToConsole>false</outputToConsole>
        <outputToFiles>true</outputToFiles>
      </log>



    Description of each entry:
     
    • <level>info</level>
      • Logging level. The default level is info. Change it to the preferred logging level. For information on the different logging levels, see the #AdditionalInformationsection.
    • <maxFileNum>30</maxFileNum>
      • Maximum number of log files
      • Increase the <maxFileNum> parameter to change the maximum number of logs
    • <maxFileSize>5242880</maxFileSize>
      • Maximum size of each log file in bytes. By default, the maximum file size is 5243904 bytes.
      • Increase the <maxFileSize> parameter to change the maximum size of the logs.
  3. Restart the VMware vCenter Server service for the change to take effect. For more information, see Stopping, starting, or restarting vCenter services (1003895).
Note: Changes done to the logging level via the vSphere Client or vSphere Web Client do not persist after a reboot and are overwritten by the default values in the vpxd.cfg file. To make permanent log level modifications, you must edit the vpxd.cfg file.

Additional Information section

Table showing different levels of logging:
 

Option

      Description

None (Disable logging)

      Turns off logging

Error (Errors only)        

      Displays only error log entries

Warning (Errors and warnings)

      Displays warning and error log entries

Info (Normal logging)

      Displays information, error, and warning log entries

Verbose (Verbose)

      Displays information, error, warning, and verbose log entries

Trivia (Extended verbose)

      Displays information, error, warning, verbose, and trivia log entries



Additional Information