Views:
If detailed debugging has to run for a number of days or weeks, use logrotate to rotate and compress log files automatically. Refer to the logrotate man page for details on logrotate.

Procedure

  1. Use a text editor such as vi, open /etc/logrotate.d/rsyslog.
    WARNING
    WARNING
    Making incorrect changes to a configuration file can cause serious system errors. Before you start, back up tmsplx.xml in case you need to restore your original settings.
  2. Add the following lines to rotate logs:
    /var/log/messages /{path}/{splxlog} {
        sharedscripts
        postrotate
            /usr/bin/systemctl kill -s HUP rsyslog.service >
    /dev/null 2>&1 || true
        endscript
    }
  3. Save and close the rsyslog file.