You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pm...@freemail.it on 2003/06/14 18:07:45 UTC

Apache Tomcat 4.1.24 logging question

Hello,

  I'm a brand new user of Apache Tomcat 4.1.24 (on windows 2000), and I have a question.

First of all, forgive me if this is trivial, but investigating the source, and various web resources, I was not capable to find the answer, so I hope you can help me.

I saw that Tomcat has a different log for each deployed web application.

And I also saw that there is a log (example: localhost_log.2003-06-14.txt) that is the server log.

I wrote a class that does some stuff, I jarred it and I've put it in the "endorsed" directory.
It is important, for me, that this class is loaded from that directory
(it is not relevant, for the sake of my question, to tell you why; just take it as a "must").

Well, how can I do to write to the server log from within that class ?
More precisely, which "import" and APIs must I use ?

Thank you very much !!

Ciao !
Matteo
-----------
pmatteo@freemail.it

Re: Apache Tomcat 4.1.24 logging question

Posted by Glenn Nielsen <gl...@mail.more.net>.
pmatteo@freemail.it wrote:
> Hello,
> 
>   I'm a brand new user of Apache Tomcat 4.1.24 (on windows 2000), and I have a question.
> 
> First of all, forgive me if this is trivial, but investigating the source, and various web resources, I was not capable to find the answer, so I hope you can help me.
> 
> I saw that Tomcat has a different log for each deployed web application.
> 
> And I also saw that there is a log (example: localhost_log.2003-06-14.txt) that is the server log.
> 
> I wrote a class that does some stuff, I jarred it and I've put it in the "endorsed" directory.
> It is important, for me, that this class is loaded from that directory
> (it is not relevant, for the sake of my question, to tell you why; just take it as a "must").
> 
> Well, how can I do to write to the server log from within that class ?
> More precisely, which "import" and APIs must I use ?
> 

If you configure your Tomcat Host with the attribute swallowOutput="true" you can just
print to System.out.  Tomcat will make sure the output gets into the appropriate Host
or web application log.

Regards,

Glenn


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org