2

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 ?

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.