aspose file tools*
The moose likes Tomcat and the fly likes How to prevent tomcat from overriding logfiles on application restart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to prevent tomcat from overriding logfiles on application restart" Watch "How to prevent tomcat from overriding logfiles on application restart" New topic
Author

How to prevent tomcat from overriding logfiles on application restart

vini singh
Greenhorn

Joined: Dec 04, 2008
Posts: 18
tomcat stdout and stderr logs are overwritten on application start, which destroys any data they might contain as to the cause of the issue that required a restart. Can we either make these rolling, or at least back up the previous one on app restart automatically, to allow for easier investigation of the root cause of issues?

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

Actually, on my Linux servers, I don't think the logs are overwritten, just appended to.

The console logfile behaviours vary, however depending not only on the OS used, but how you start up Tomcat. What really determines what's going to happen is how the Tomcat startup is managed, however. I have seen several Tomcat implementations where the master startup process moved the old logfiles to alternate locations in order to preserver them, and often also did rotation where the older logfiles would eventually be deleted.

That kind of work is usually done by a separate startup script that calls the Tomcat startup script, but occasionally people will modify the Tomcat startup script itself.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to prevent tomcat from overriding logfiles on application restart