File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Rotating Tomcat STDOUT_timestamp & STDErr_timestamp log files ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Rotating Tomcat STDOUT_timestamp & STDErr_timestamp log files ?" Watch "Rotating Tomcat STDOUT_timestamp & STDErr_timestamp log files ?" New topic

Rotating Tomcat STDOUT_timestamp & STDErr_timestamp log files ?

Suneel Kum

Joined: Jul 28, 2010
Posts: 1
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....


tomcat 5.5
windows xp operating system.

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

thank you in advance
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Rotating Tomcat STDOUT_timestamp & STDErr_timestamp log files ?
jQuery in Action, 3rd edition