: How log rotation is done in Tomcat for access logs How log rotation is done in Tomcat ie catalina.out and access.out ? We can logrotate for catalina.out : # vim /etc/logrotate.d/tomcat7 /var/log/tomcat7/catalina.out
How log rotation is done in Tomcat ie catalina.out and access.out ?
We can logrotate for catalina.out :
# vim /etc/logrotate.d/tomcat7
/var/log/tomcat7/catalina.out {
copytruncate
daily
# rotate 52
rotate 90
compress
missingok
create 640 tomcat7 adm
}
In same way can we do it for access logs ?
More posts by @Sims2060225
1 Comments
Sorted by latest first Latest Oldest Best
logrotate is a tool independent from tomcat. It can be used with log files generated by any kind of applications.
You can add a rule for the access.out tomcat log file in the /etc/logrotate.d/tomcat7 logrotate configuration file. If you want to apply the same rules as for /var/log/tomcat7/catalina.out you can modify your configuration file like this:
/var/log/tomcat7/catalina.out /var/log/tomcat7/access.out{
copytruncate
daily
# rotate 52
rotate 90
compress
missingok
create 640 tomcat7 adm
}
Read the manual for more information.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.