Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Can't do log rotation on windows

Cervenka, Tom

2005-02-14

Replies:

I’ve got tomcat 4 running on a win2003 server and it spits it’s log messages to a catalina.out file. Once a day I want to rotate the log – copy it, zip up the copy and truncate the original. I do this on linux with a simple shell script. Tomcat is running during all of this and has its mitts into the file but linux doesn’t seem to care. Different story on windows, however. The short story is that catalina.out is corrupted big time.

 

I’ve had 2 ideas to work around this. One is to stop the service before truncating the file and start it up again afterwards. This works but win2003 can’t always restart the service, like 50% of the time. So I’ve given up on this route. I need a solution that works while tomcat is running.

 

The only idea I’ve had for this is to try to get tomcat to use a filelogger like it provides for it’s contexts. I made the changes to server.xml but then never did doodly squat. I know I’m not the only one that’s had trouble doing this on windows as I’ve seen other notes to list about it. I posted a note a while back (attached) but no response. Is it because no one runs tomcat on windows?

 

-Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.