Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
695 views
in Technique[技术] by (71.8m points)

logging - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...