Basic Servlet Question

R

Rhino

Can anyone help me with a very basic servlet question? I used to know this
but can't recall now and haven't been able to find it anywhere....

Where does System.out.println() write when it is in a servlet? When I am
running in Eclipse/Tomcat 4.1.29, it writes to the Eclipse console. However,
when I export the WAR file to Tomcat on our Linux server, I don't see the
System.out.println() output anywhere.

For what it's worth, I am only using System.out.println() in my servlet to
write diagnostic data to help me debug a problem; I know I shouldn't use it
for anything else ;-)
 
D

Darryl L. Pierce

Rhino said:
Can anyone help me with a very basic servlet question? I used to know this
but can't recall now and haven't been able to find it anywhere....

Where does System.out.println() write when it is in a servlet? When I am
running in Eclipse/Tomcat 4.1.29, it writes to the Eclipse console.
However, when I export the WAR file to Tomcat on our Linux server, I don't
see the System.out.println() output anywhere.

Look at logs/catalina.out
 
T

Tony Morris

Rhino said:
Can anyone help me with a very basic servlet question? I used to know this
but can't recall now and haven't been able to find it anywhere....

Where does System.out.println() write when it is in a servlet? When I am
running in Eclipse/Tomcat 4.1.29, it writes to the Eclipse console. However,
when I export the WAR file to Tomcat on our Linux server, I don't see the
System.out.println() output anywhere.

For what it's worth, I am only using System.out.println() in my servlet to
write diagnostic data to help me debug a problem; I know I shouldn't use it
for anything else ;-)

This is container dependant behaviour.
It could be written to /dev/null for all your servlet knows.

Typically, most containers write stdout and stderr to files by default; some
provide the ability to redirect to streams other than files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,616
Members
45,306
Latest member
TeddyWeath

Latest Threads

Top