Information
The system includes the capability of rotating log files regularly to avoid filling up the system with logs or making the logs unmanageably large. The file /etc/logrotate.d/rsyslog is the configuration file used to rotate log files created by rsyslog
By keeping the log files smaller and more manageable, a system administrator can easily archive these files to another system and spend less time looking through inordinately large log files.
Note: This recommendation only applies if rsyslog is the chosen method for client side logging. Do not apply this recommendation if systemd-journald is used.
Solution
Edit /etc/logrotate.conf and /etc/logrotate.d/* to ensure logs are rotated according to site policy.
Example logrotate configuration that specifies log files be rotated weekly, keep 4 backlogs, compress old log files, ignores missing and empty log files, postrotate to reload rsyslog service after logs are rotated
/var/log/rsyslog/*.log {
weekly
rotate 4
compress
missingok
notifempty
postrotate
/usr/bin/systemctl reload rsyslog.service >/dev/null || true
endscript
}