tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: How to split the default stdout log?
Date Tue, 06 Jul 2010 12:51:48 GMT
> From: 郑翼羽 [mailto:groundzyy@gmail.com]
> Subject: Re: How to split the default stdout log?
> 
> But when tomcat5 starts, it will generate a file like
> stdout_yyyymmdd.log, but when it runs for a couple of
> days, there will be only one file

Not sure there's going to be any ready way for Tomcat to fix sloppy webapp programming, but
start with setting swallowOutput to true in the <Context> of interest (or in the global
one).  This will divert stdout and stderr for each webapp to the webapp's logger.  You can
then use log4j in the webapp, and make use of its built-in rotation capabilities.

Look here for the doc:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
http://tomcat.apache.org/tomcat-5.5-doc/logging.html

You should also take a look at the FAQ entries on logging:
http://wiki.apache.org/tomcat/FAQ/Logging

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

Mime
View raw message