The default logging setup for Cloud Director is 10 files at 10MB each. Depending on how busy your environment is, these logs can roll over very quickly. Industry best practice is to send your logs to a Syslog server, VRLI or a o11y tool such as Tanzu Observability.
The other option is to increase the size and number of files that the system logs. Please note that this will increase the size of the files so ensure you have enough capacity on the shared NFS space.
All Cloud Director versions.
The location of the file that you need to edit is:
/opt/vmware/vcloud-director/etc/log4j.properties
We'll focus on the vcloud-container-debug.log block in that file as the debug level log files are the most important piece of evidence a TSE needs when triaging a case.
This is the default:
# Component appender for container debug
log4j.appender.vcloud.system.debug=org.apache.log4j.RollingFileAppender
log4j.appender.vcloud.system.debug.File=logs/vcloud-container-debug.log
log4j.appender.vcloud.system.debug.MaxFileSize=10240KB
log4j.appender.vcloud.system.debug.MaxBackupIndex=9
log4j.appender.vcloud.system.debug.layout=com.vmware.vcloud.logging.layout.CustomPatternLayout
log4j.appender.vcloud.system.debug.layout.ConversionPattern=%d{ISO8601} | %-8.8p | %-25.75t | %-30.50c{1} | %m | %x%n
log4j.appender.vcloud.system.debug.threshold=DEBUG
What does this all mean?
We'll break this line down below.
Let's say you want to retain 72 hours of activity in the logs, given that the default logging level is good for 8 hours.
10 logs files at 10MB each cover an 8-hour period, which means:
Since the logs are capped at 10MB, we can assume that the actual log size per hour is approximately 10MB.
To cover a 72-hour period, we need to calculate the total log size required:
We want to store the logs in 50MB files. To calculate how many files we need, we can divide the total log size by the file size:
Round up to the nearest whole number. In this case we would need 15 files, each 50MB in size to cover a 72-hour period plus an extra 5 for good measure.
Ensure you have a backup of the default settings.
Open the file in your favourite editor and look for these lines:
log4j.appender.vcloud.system.debug.MaxFileSize=10240KB
log4j.appender.vcloud.system.debug.MaxBackupIndex=9
Replace them with:
log4j.appender.vcloud.system.debug.MaxFileSize=51200KB
log4j.appender.vcloud.system.debug.MaxBackupIndex=20
Perform the same steps on all Cloud Director appliances and then restart the vmware-vcd service:
service vmware-vcd restart