Introduction
Logrotate is used by the system to rotate out various logs through a server to ensure files either do not get too big or have a proper separation between dates to allow for more manageable log files in case they need to be reviewed.
Procedure
Each log file has its own configuration file which can be found in the following location:
/etc/logrotate.d/
Here is an example of the configuration for PHP-FPM 56.
[root@the ~]$ cat /etc/logrotate.d/ea-php56-php-fpm
/opt/cpanel/ea-php56/root/var/log/php-fpm/*log {
missingok
notifempty
sharedscripts
delaycompress
postrotate
/bin/kill -SIGUSR1 `cat /opt/cpanel/ea-php56/root/var/run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true
endscript
}
These configuration files can be modified to include additional directives and rules to fit the rotation that you desire.
For a list of the available directives and rules that you can use you may refer to the following external resource.