Configuring log rotation by file size in vRA and vRO
search cancel

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.

Resolution

This issue is resolved in vRealize Automation 7.0.1 and later available at VMware Downloads</u>.

To work around this issue if you do not want to upgrade:

To configure the log rotation in the VMware vRealize Automation appliance by file size:
  1. 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.
  2. 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:
  1. Log in to the VMware vRealize Automation appliance.
  2. Navigate to:

    /etc/logrotate.d/

  3. 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:
  1. 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:

    0 */1 * * * /usr/sbin/logrotate /etc/logrotate.d/vcac.lr
    5 */1 * * * /usr/sbin/logrotate /etc/logrotate.d/vco.lr

  2. Save the file.
  3. Run this command to confirm that the information is configured properly:

    crontab -l