Configuring logging for VMware vCloud Director cells
search cancel

Configuring logging for VMware vCloud Director cells

book

Article ID: 330113

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

This article discusses the different log files in vCloud Director, their locations, the different logging levels and how to increase the log file sizes and the number of copies to keep.

Increasing the amount of diagnostic data (log file size and the number of logs to keep) may be required to troubleshoot a problem with vCloud Director.


Resolution

Log Locations

  • For vCloud Director version 1.5 and forward, the logs are stored in /opt/vmware/vcloud-director/logs

Configuration File

  • For vCloud Director version 1.5 and forward, the log configuration file is located in /opt/vmware/vcloud-director/etc/. The log configuration file is called log4j.properties.

Logging Levels

These six logging levels can be defined:
  • FATAL – logs very severe error events that may cause the application to fail
  • ERROR – logs error events that might still allow the application to continue running
  • WARN – logs potentially harmful situations and warnings
  • INFO – logs informational messages that highlight the progress of the application at a coarse-grained level
  • DEBUG – logs informational events that are most useful to debug an application at a fine-grained level
  • TRACE – logs informational events at a level more fine-grained than DEBUG logging
To change the logging level:
 
Caution: Before making any changes to the /opt/vmware/vcloud-director/etc/log4j.properties file, VMware recommends that you make a backup copy.
  1. Open the /opt/vmware/vcloud-director/etc/log4j.properties file in a text editor (such as vi or nano).
     
  2. Locate this section:
    # Default vCloud loggers log4j.logger.com.vmware.vcloud=DEBUG log4j.logger.com.vmware.ssdc=DEBUG
  3. Replace DEBUG and ERROR with one of the other logging levels. The following example will set vcloud and sddc to TRACE level.

    For example:
    log4j.logger.com.vmware.vcloud=TRACE log4j.logger.com.vmware.ssdc=TRACE
    
  4. Now we need to change how the log file records information. Locate the section starting with:
    # appender for all log requests with level >= DEBUG
  5. The last line of the section configures the level of logging the file will capture. This needs to be changed to match the most verbose level. In the list of logging levels at the top of this document, TRACE is the most verbose and FATAL is the least verbose.
    log4j.appender.vcloud.system.debug.threshold=TRACE  
  6. If you choose a new logging level that is more verbose, you may need to increase the number of log backups and or the size of the log files.
    1. Locate the lines:

      log4j.appender.vcloud.system.debug.MaxFileSize=
      log4j.appender.vcloud.system.debug.MaxBackupIndex=
       
    2. Change the default settings.

      This example a
      llows the log files to grow to 25 MB before they will rollover and keeps the last 5 logs:

      log4j.appender.vcloud.system.debug.MaxFileSize=25000KB
      log4j.appender.vcloud.system.debug.MaxBackupIndex=5

       
  7. Save the file and the settings should be applied immediately.

    The Log4J.properties does not have explicit lines for changing the size and amount of logs that are kept.

They use the following configuration properties:

vcloud.http.log.maxFileSize (default=5*1024*1024)

vcloud.http.log.maxTotalLogSize (default=10*5*1024*1024)

 

vcloud.http.log.retainDays (default=5)



Additional Information

For information on collecting the logs, see Collecting diagnostic information for VMware vCloud Director (1026312).

Collecting diagnostic information for VMware vCloud Director 1.x / 5.x