vCenter and Solutions Logs: How to Change the Settings

Logging is an important tool for system monitoring and troubleshooting. vCenter has comprehensive logs for itself and related solutions. We’ll introduce how to change the settings for these logs in vCenter appliance. One obvious use case is to increase the log levels for troubleshooting.

vCenter Logs
As usual, the vCenter configuration file resides in a subfolder in the /etc folder.

Lost VMs or Containers? Too Many Consoles? Too Slow GUI? Time to learn how to "Google" and manage your VMware and clouds in a fast and secure HTML5 App.

# vim /etc/vmware-vpx/vpxd.cfg

As you can see, the log level is defined within the tag with default value of info. All the levels of vCenter include none, error, warning, info, verbose, trivia, in an order from less to more detailed messages.

The vCenter logs are in the /var/log/vmware/vpx folder with file name starting with vpxd prefix. You can use vSphere API to access the logs. In parallel with vpx folder are sso, vami, vsphere-client for related logs.

vCenter Solutions Logs
Most of the solutions on vCenter are written in Java with log4j framework for logging. To change the settings of the logs for these solutions, you need to change the corresponding file.

To find out these files, it’s pretty easy on the vCenter appliance with the find command as follows:

# find / -name

Most of these files can be easily mapped to corresponding components. As expected, the files follow the standard log4j framework. The following is an example file:

# vim /usr/lib/vmware-vpx/tomcat/webapps/vws/WEB-INF/classes/
# Set root category priority to ERROR and appender to LOGFILE
log4j.rootCategory=ERROR, LOGFILE
# Set vim package loggers
# Uncomment additivity line to not log event logs to LOGFILE
# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE.layout.ConversionPattern=[%d{ISO8601} %t %x %-5p %c] %m%n
# CIM Diagnostics, DIAG
# DIAG is set to be a File appender using a PatternLayout.
log4j.appender.DIAG.layout.ConversionPattern=[%d{ISO8601} %x %c] %m%n
#Jointool logs, JOINTOOL
log4j.appender.JOINTOOL.layout.ConversionPattern=[%d{ISO8601} %x %c] %m%n

After changing the properties file, you want to restart the tomcat as follows:

/etc/init.d/vmware-vpxd tomcat-restart

Log4J levels
Log4j defines 6 levels of logs: TRACE, DEBUG, INFO, WARN, ERROR, FATAL, in the order of descending details. Each level would include the logs of levels coming after itself. You can also use another two: ALL, OFF.

With the TRACE or ALL, you will have quite lots of (most likely more than you like to see) entries in the log file, which may slow down the system. For that, you want to reverse it back to default INFO level.

This entry was posted in Virtualization and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.