To configure the log rotation in the VMware vRealize Orchestrator Appliance by file size:
- Set the maximum log file size for the vRealize Orchestrator logs.
- Configure a cron job to run
logrotate
based on a time interval.
To set the maximum log file size for vRealize Orchestrator logs:
- Log in to the VMware vRealize Orchestrator appliance.
- Navigate to this location:
/etc/logrotate.d/
- Edit or create the
vco.lr
file and add the following code:
Note: The code is an example.
/var/log/vmware/vco/app-server/catalina.out {
size 5M
rotate 5
start 1
compress
missingok
nocreate
notifempty
sharedscripts
copytruncate
su vco vco
}
/var/log/vmware/vco/app-server/localhost_access_log.txt {
size 5M
rotate 20
start 1
compress
missingok
nocreate
notifempty
sharedscripts
copytruncate
su vco vco
}
With this configuration
logrotate
compresses and rotates the logs after reaching the defined size and rotate number limits. After setting the maximum log file size, configure a cron job to run
logrotate
based on a time interval:
- Copy logrotate script to
/etc/cron.hourly
:
cp /etc/cron.daily/logrotate /etc/cron.hourly
- Edit the file and replace
/usr/sbin/logrotate /etc/logrotate.conf 2>&1 | tee $TMPF
with /usr/sbin/logrotate /etc/logrotate.d/vco.lr 2>&1 | tee $TMPF
- Edit
/etc/vco/app-server/server.xml
and add the rotatable="false"
and checkExists="true"
attributes to the Valve
tag with a class name className="org.apache.catalina.valves.AccessLogValve"
just before closing the tag. - Restart the Orchestrator server.
After you complete the procedure,
logrotate
checks the log files described in
vco.rl
hourly for their size and if size is exceeded, it compresses the old file and creates a new one.