logrotate
Example - catalina.out
Create and insert
About the above configuration:
Make sure that the path /var/log/tomcat/catalina.out above is adjusted to point to your tomcat’s catalina.out
daily - rotates the catalina.out daily
rotate – keeps at most 7 log files
compress – compressesthe rotated files
size – rotates if the size of catalina.out is bigger than 5M
Run command manually:
Stolen from here - click
Disable
To stop a specific logrotate process, find its configuration file in /etc/logrotate.d/, rename it by adding a .disabled extension, or move the file to another directory. You can also edit the file to comment out its contents or add a nomail directive to prevent emails, though renaming is the most direct way to stop its function.