• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

How to prevent tomcat from overriding logfiles on application restart

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

 
Saloon Keeper
Posts: 28141
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
He baked a muffin that stole my car! And this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic