• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rotating Tomcat STDOUT_timestamp & STDErr_timestamp log files ?

 
Suneel Kum
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone

I am trying to rotate my tomcat STDOUT_timestamp & STDErr_timestamp logs.
The problem is with my app. (9 apps) which actually write to stdout (using consoleappender), this makes my stdout file
very large. so, i decided to rotate that stdout log file.

So, please does any one know if it is possible....can we use piped log just as apache server does?
please any solutions and suggestions are highly valuable....because i am kinda stuck here....

configuration:

tomcat 5.5
windows xp operating system.

please let me know if you need anymore info...

thank you in advance
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Suneel!

I recommend that you don't use the ConsoleAppender for individual webapps, except to log severe errors. The ability to rotate stdout/stderr varies depending on the OS. And although I believe there is a facility that you can pipe the stdout/stderr streams through that can be manipulated to do things like rotation, there are good reasons for not doing that.

You'll generally do better to have each application log its non-error messages to a separate logfile. That makes reading the logs easier, since you don't have to pick out the messages for whichever app you're investigating and you don't risk accidentally thinking that a message from a completely unrelated app is coming from the app you want to look at.

Also, there is an appender specifically designed to rotate logfiles, so you can very easily set up logfile rotation. You can't do that with stdout/stderr, since they are streams, not files.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic