Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

catalina.out rolling with Tomcat 6.0

I have a default tomcat installation with no change to the logging configuration. The log files (in particular catalina.out) appear to be getting rolled (daily) correctly.

However as well as the daily logs there is also a catalina.out file, which just continues to grow. This is what I need to fix, ie have it cleared daily (or remove it altogether if possible)

Can someone explain what is going on here and the best best strategy for controlling that log file size?

Just to clarify the output is being written to catalina.out and the daily log simultaneously

-rw-r--r--  1 solr solr   90920663 Jul 18 01:16 logs/catalina.2009-07-18.log -rw-r--r--  1 solr solr     238010 Jul 18 01:16 logs/catalina.out 

Setting swallowOutput appears to not make any difference.

The application being run under tomcat is solr in case that is relevant.

like image 474
objects Avatar asked Jul 18 '09 05:07

objects


People also ask

What is Catalina out in Tomcat?

The catalina.out log messages and log files communicate events and conditions that affect Tomcat server's operations. Logs for all identity applications components including OSP and Identity Reporting are also logged to the catalina.out file.


2 Answers

Fixed it, turns out the standard logging configuration defines a file logger and also a console logger. The file logger goes to the daily catalina log, and the console logger writes to catalina.out.

Fix was to change in conf/logging.properties:

.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler 

to

.handlers = 1catalina.org.apache.juli.FileHandler 

That stops anything getting written to catalina.out

like image 146
objects Avatar answered Sep 19 '22 12:09

objects


Hi you may want to try this solution

http://java.dzone.com/articles/how-rotate-tomcat-catalinaout

It uses a cronjob (logrotate) to copy, compress and clean your catalina.out and if you have a look at logrotate you will see it has a lot of additional functionality. It does not interfere with the daily logs, unless you configure it do so. I found it helpful when I was confronted with the same problem.

BTW removing the console handler will only affect messages produced by Tomcat.

like image 23
Rambo Amadeus Avatar answered Sep 21 '22 12:09

Rambo Amadeus