You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by klute <so...@yahoo.com> on 2003/03/28 21:19:32 UTC

best practices on rotating tomcat logs

Hi All,

i run tomcat behind apache via mod_jk. currently i
define a timestamped <Logger> for each <Context> in my
server.xml:

<Logger
className="org.apache.catalina.logger.FileLogger"
          prefix="mycontextA." suffix=".txt"
          timestamp="true"/>

and a logger for my engine in which all the contexts
reside:

<Logger
className="org.apache.catalina.logger.FileLogger"
        prefix="apache_log." suffix=".txt"
        timestamp="true"/>

All the tomcat's sdtout goes to catalina.out (default
setup).

I am wondering if this is pretty much what other
people do and if there is a better way of doing it. 

i just found that apache can rotate its logs with its
bin/rotatelogs where you can specify the rotation
interval. 

does tomcat have a similar functionality? i searched
for "rotate" in Tomcat's source and found the
AccessLogValve class which could be i want, but i need
help figuring it out.

thanks a lot!
james


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: best practices on rotating tomcat logs

Posted by jerome moliere <jm...@nerim.net>.
>
>
>I am wondering if this is pretty much what other
>people do and if there is a better way of doing it. 
>
>i just found that apache can rotate its logs with its
>bin/rotatelogs where you can specify the rotation
>interval. 
>
>does tomcat have a similar functionality? i searched
>for "rotate" in Tomcat's source and found the
>AccessLogValve class which could be i want, but i need
>help figuring it out.
>
>  
>
in fact Tomcat knows nothing about how its logs are managed...
it just outputs logs which are treated by log4j using the common logging API
so you can use the log4j feature for having your log files rotating..
Use a RollingFileAppender in the  log4j properties file...

HTH
Jerome


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org