• Post Reply Bookmark Topic Watch Topic
  • New Topic

TomCat System.out redirection to Log file ?

 
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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!