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
- Use a text editor such as
vi
, open/etc/logrotate.d/syslog
.WARNING
Making incorrect changes to a configuration file can cause serious system errors. Before you start, back uptmsplx.xml
in case you need to restore your original settings. - Add the following lines to rotate logs:
/var/log/messages /{path}/{splxlog} { sharedscripts postrotate /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true endscript }
- Save and close the
syslog
file.