This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am using apache tomcat for running servlets. I would like my servlet to print out some debug statements when it is executes. I have included some console output statements. I am not sure where to look for the debug output. Where are these debug statements getting printed? Thanks in advance. Have a good day, Kris.
It depends on how you've coded your debug statements.
If you use System.out or System.err then both of these are being redirected to the console window (on Windows) and I *think* to catalina_out on *nix.
But how about using the log() method provided by your servlet? This way, it doesn't clutter your console window, and it is accessed by looking at : /CATALINA_HOME/logs/localhost_log.2002-08-29.txt
example:You could also redirect System.err or System.out back to where you wanted... I haven't tried this though, and perhaps there will be permissions trouble with this: java.lang.System.setOut(PrintStream out) So you would supply it with a value for 'out' that you want.