VMware Cloud Director has different logging levels. The default logging configuration might not be sufficient for busy environments or for capturing events whilst troubleshooting. You might need to change the level of logging and even the sizes and number of files retained.

Important: Verify that you are aware of the consequences to your VMware Cloud Director server group when making changes to the log configuration without guidance from the VMware Global Support team. If you change a logging level to a more verbose one, the logs might start to expand very fast, and your VMware Cloud Director environment might run out of disk space.

The VMware Cloud Director logs are located in the /opt/vmware/vcloud-director/logs/ directory.

The VMware Cloud Director log configuration file is located in the /opt/vmware/vcloud-director/etc/ directory. The name of the log configuration file is log4j.properties.

If you customize the log4j.properties log configuration file, before a VMware Cloud Director upgrade, you must make a copy of the log4j.properties, and after the upgrade, manually insert any missing sections.

To improve your log retention and to ensure that the VMware Cloud Director logs are kept for a certain amount of time, consider using a syslog server.

Table 1. Logging Levels
Logging Level Description
FATAL This level logs very severe error events that might cause the application to fail.
ERROR This level logs error events that might still allow the application to continue running.
WARN This level logs potentially harmful situations and warnings.
INFO This level logs informational messages that highlight the progress of the application at a coarse-grained level.
DEBUG This level logs informational events that are most useful to debug an application at a fine-grained level.
TRACE This level logs informational events at a more fine-grained level than the DEBUG level logging.

Prerequisites

Make a backup copy of the /opt/vmware/vcloud-director/etc/log4j.properties file.

Consider

Procedure

  1. Log in directly or by using an SSH client to the VMware Cloud Director console as root.
  2. Open the /opt/vmware/vcloud-director/etc/log4j.properties file in a text editor.
  3. Locate the log file definition that you want to update.
    log4j.appender.Feature.File=logs/File_Name
    For example, you might want to change the logging level for the # Component appender for container debug section. The last line of the section configures the level of logging that the file captures.
  4. Set the logging level to the value you want.
    Important: Verify that you are aware of the consequences to your VMware Cloud Director server group when making changes to the log configuration without guidance from the VMware Global Support team.
    TRACE is the most verbose level and FATAL is the least verbose. The following example changes the line to match the most verbose level.
    log4j.appender.vcloud.system.debug.threshold=TRACE
  5. If you change the recording to a more verbose level, you might need to increase the number of log backups and the size of the log files.
    1. Locate the MaxFileSize and MaxBackupIndex lines.
      log4j.appender.vcloud.system.debug.MaxFileSize=
      log4j.appender.vcloud.system.debug.MaxBackupIndex=
    2. Change the default settings.
      For example, if you want the log files to expand to 50 MB before they rollover and to keep the last 18 logs, change the lines as follows.
      log4j.appender.vcloud.system.debug.MaxFileSize=50000KB
      log4j.appender.vcloud.system.debug.MaxBackupIndex=18
      When a file reaches the selected 50 MB size, VMware Cloud Director continues to log data in a new file and keeps up to 18 backups.
    Important: If you change a logging level to a more verbose one, the logs might start to expand very fast, and your VMware Cloud Director environment might run out of disk space.
  6. Save the /opt/vmware/vcloud-director/etc/log4j.properties file.
    VMware Cloud Director applies the changes immediately. The Log4J.properties file does not have explicit lines for changing the size and amount of logs that VMware Cloud Director keeps.