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 ?

Ashish Karpe
  • 123
  • 1
  • 5

1 Answers1

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.

Ortomala Lokni
  • 162
  • 1
  • 6