Mobile app version of vmapp.org
Login or Join
Sims2060225

: 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

@Sims2060225

Posted in: #Logging #Logs #Tomcat

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 ?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sims2060225

1 Comments

Sorted by latest first Latest Oldest Best

 

@Si4351233

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme