This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

TomCat System.out redirection to Log file ?  RSS feed

 
khudiram Barik
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We just installed TomCat-3.2.1 in stand-alone mode and JVM is jdk1.2.2; Now System.out.println goes to TomCat console, we want to go to a log file. How and where to do the required set-up.
Thanks in advance.
 
Nitin Dubey
Ranch Hand
Posts: 126
Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i too is going through tomcat right now. as per my knowledge a option is to make a log writer that writes to a file or u can also change your default err output to a file. for that, i think u need to connect file output stream and system.err.
nitin

 
khudiram Barik
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nitin !
I am looking if there is any way to do set up in web.xml or server.xml or ... to direct the System.out and System.err.
In my program I have used like this
PrintStream n = new PrintStream( new FileOutputStream("c:/khudi/log.txt", true), true) ;
System.setErr(n);
System.err.println("My Error");

This works and goes to c:/khudi/log.txt but to know if we can set up somewhere instead of using the above.
Thanks.
Khudiram
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!