Workaround to enable log rotation

Use this workaround to enable log rotation for rsyslog.

Version 10.0.3 or earlier

For API Connect v10.0.3 or earlier on VMware, there is a known limitation in which prevents the log rotation feature from working correctly. The limitation can cause syslog to grow very large and consume all available disk space. In some cases, this can cause the node to go down.

To workaround this problem, use the following instructions to delete or move the syslog and fix log rotation:

  1. SSH into the appliance as root.
  2. If the existing syslog file is problematic, remove it:
    1. Change directory to /var/log.
    2. Delete the syslog file.

      Alternatively, if you need to retain the contents of the log file, move it to a location out of the VM.

  3. Enable hourly log rotation:
    1. Run:
      sed -i 's/invoke-rc.d\ rsyslog rotate\ >\ \/dev\/null/killall\ -HUP\ rsyslogd/g' /etc/logrotate.d/rsyslog
    2. Run:
      sed -i 's/AccuracySec=12h/AccuracySec=1us/g; s/daily/hourly/gi' /lib/systemd/system/logrotate.timer
    3. Run
      systemctl daemon-reload

To review configuration steps for logging, see Configuring remote logging for a VMware deployment.