This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes how to redirect System.err to file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "how to redirect System.err to file" Watch "how to redirect System.err to file" New topic
Author

how to redirect System.err to file

Rashmi Verma
Greenhorn

Joined: May 15, 2005
Posts: 20
Hi all,

I am working with Tomcat 5.0 and want to redirect all the System.err and System.out from console to a file so that the console will always be clear . Please suggest a way to do it , i have tried out by changing the logger tags also but it dint helped

thanks in advance

Rashmi

SCJP1.4 , SCWCD 1.4


Rashmi Verma <br />SCJP 1.4 , SCWCD 1.4, SCDJWS 1.4
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

If your app is writing to System.out and System.err, you'd be best served to change that to using a logging package. The java.util.logging package is readily available in the standard packages, or the popular and powerful Log4J package can be easily added.

Either will give you more control over where your messages get written.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to redirect System.err to file
 
Similar Threads
console output
Intercept And Formatting System.err
IO System.out & System.err
System class and available methods
How do u print the error to a file