Article ID: 117218, created on Sep 12, 2013, last review on May 23, 2016

  • Applies to:
  • Operations Automation

Symptoms

As Provider I want to rotate POA logs on the Linux-based POA Management Node after the logs reach a certain size.

Resolution

POA for Linux is using the native Linux logrotate utility to rotate own logs.

The rotation settings for the log files /var/log/poa.log and /var/log/poa.debug.log on the POA Management Node are configured in the /etc/logrotate.d/syslog file, the default settings are as follows:

/var/log/poa.log {
        rotate 28
        daily
        compress
        dateext
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
        /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

/var/log/poa.debug.log {
        rotate 14
        daily
        compress
        dateext
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
        /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

You may configure log rotation by size - add the following line to the corresponding section (poa.log or poa.debug.log) in the /etc/logrotate.d/syslog file on the POA Management Node:

size=<size in megabytes>M

Here is the example of the resulting file for rotating logs when they grow bigger than 1024 MB:

/var/log/poa.log {
        rotate 28
        size 1024M
        daily
        compress
        dateext
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
        /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

/var/log/poa.debug.log {
        rotate 14
        size 1024M
        daily
        compress
        dateext
    postrotate
        /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
        /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true
    endscript
}

Yoy may also configure the same parameters for additional POA logs in the /etc/logrotate.d/poa file on the POA Management Node.

No need to restart any services after changing the log rotation configuration files.

Refer to the man page for the logrotate utility for more information about the log rotation parameters.

Search Words

Disk full

poa.log shrink

log rotate

debug level

caea8340e2d186a540518d08602aa065 5356b422f65bdad1c3e9edca5d74a1ae e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF