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.
- Open the /opt/vmware/vcloud-director/etc/log4j.properties file in a text editor (such as vi or nano).
- Locate this section:
# Default vCloud loggers log4j.logger.com.vmware.vcloud=DEBUG log4j.logger.com.vmware.ssdc=DEBUG
- 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
- Now we need to change how the log file records information. Locate the section starting with:
# appender for all log requests with level >= DEBUG
- 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
- 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.
-
- Locate the lines:
log4j.appender.vcloud.system.debug.MaxFileSize=
log4j.appender.vcloud.system.debug.MaxBackupIndex=
- Change the default settings.
This example allows 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
- 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)