Log rotation

Log rotation consists of archiving, compressing and then deleting old log files so they do not saturate the disk. logrotate automates it according to rules for frequency, size and number of files kept, defined in /etc/logrotate.d/.

Example

/var/log/app/*.log { weekly rotate 4 compress }

Related concepts

The whole glossary