You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Dr. Evil" <dr...@sidereal.kz> on 2001/10/19 10:29:44 UTC

Logging from a servlet in Tomcat

I have a question: It would be extremely useful for a servlet to be
able to record debugging messages in some way.  I don't have a Java
debugger, but I could do a lot of debugging if I had a command that
looked like this:

log("We are in this part of the code now");

I have seen documentation for a command like that, and I have tried it
in my installation of Tomcat 4.0, but it doesn't send any output
anywhere, so it seems useless.  Is there a way to get it to work?

Thanks

Re: Logging from a servlet in Tomcat

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On 19 Oct 2001, Dr. Evil wrote:

> Date: 19 Oct 2001 08:29:44 -0000
> From: Dr. Evil <dr...@sidereal.kz>
> Reply-To: tomcat-user@jakarta.apache.org
> To: tomcat-user@jakarta.apache.org
> Subject: Logging from a servlet in Tomcat
>
>
> I have a question: It would be extremely useful for a servlet to be
> able to record debugging messages in some way.  I don't have a Java
> debugger, but I could do a lot of debugging if I had a command that
> looked like this:
>
> log("We are in this part of the code now");
>
> I have seen documentation for a command like that, and I have tried it
> in my installation of Tomcat 4.0, but it doesn't send any output
> anywhere, so it seems useless.  Is there a way to get it to work?
>

By default, log output from your servlets goes to a file in the "logs"
directory.  You can change where it goes by setting up a <Logger> element
to do what you want.  Configuration information is included in Tomcat's
download, or available online at:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/logger.html

> Thanks
>

Craig