Configuring log rotation by file size in vRA and vRO
book
Article ID: 328551
calendar_today
Updated On:
Products
VMware Aria Suite
Issue/Introduction
This article provides steps to configure the log rotation in the VMware vRealize Automation appliance by file size instead of daily rotation, which is by default.
Environment
VMware vRealize Automation 7.x
Resolution
To configure the log rotation in the VMware vRealize Automation appliance by file size:
Set the maximum log file size for the vRealize Orchestrator (formerly known as vCenter Orchestrator) and VMware vRealize Automation (formerly known as vCloud Automation Center) logs.
Configure a cron job to run logrotate based on a time interval.
To set the maximum log file size for vRealize Orchestrator and VMware vRealize Automation logs:
Log in to the VMware vRealize Automation appliance.
Navigate to:
/etc/logrotate.d/
Edit the vcac.lr and vco.lr files and add the size entry. This sets the minimum file size detected before rotation occurs.
For example, after configuring the catalina.out (vcac.lr) log file for 100 MB maximum file size:
/var/log/vmware/vcac/catalina.out { daily rotate 5 dateext compress minsize 5M missingok nocreate notifempty sharedscripts copytruncate su vcac vcac size 100M }
After setting the maximum log file size, configure a cron job to run logrotate based on a time interval:
From the /etc/logrotate.d/ location, run the command:
crontab -e
In this example, the first line sets logrotate to run against the VMware vRealize Automation logs at the start of the hour. The second line sets logrotate to run against the vRealize Orchestrator logs after 5 minutes of start of each hour: