Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to redirect System.err to file

 
Rashmi Verma
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic