You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Silvia Righini <sh...@gmail.com> on 2011/10/19 16:37:23 UTC

can't set tomcat to use log4j for its internal logging

Hi everyone,

I'm trying to tell tomcat to use log4j for its internal logging, but it just
ignores me..
I have Tomcat 6.0.33 running on a Mac OS X 10.5.8 (with java openjdk version
"1.6.0-internal").

I followed to the letter the docs at
http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Using_Log4j
I put log4j.properties (copy and paste right from the docs) in
/usr/local/tomcat/lib, got log4j-1.2.16.jar in /usr/local/tomcat/lib, and
put tomcat-juli-adapters.jar and (new) tomcat-juli.jar in
/usr/local/tomcat/bin.
I deleted logging.properties. As I start tomcat (through startup.sh) it
tells me $CATALINA_HOME and $CATALINA_BASE are both set to
/usr/local/tomcat, so I just skipped point 5 of the docs.

At this point, Tomcat just logs to catalina.out.
Whatever i put in log4j.properties just gets ignored (i changed the
conversion pattern, and the file name of the log files and restarted tomcat,
but no change.. tomcat logs as it always did.. and to catalina.out alone
now).

I added -Dlog4j.debug to $JAVA_OPTS in catalina.sh, but i don't get any
output from it. I have a project on Tomcat that gets correctly deployed and
uses log4j (with its own log4j.properties in its war/classes), and for this
project i can see the result of -Dlog4j.debug, but nothing regarding Tomcat
itself.

This issue is driving me crazy, any hint is appreciated! :)
Thanks

Silvia

Re: can't set tomcat to use log4j for its internal logging

Posted by Silvia Righini <sh...@gmail.com>.
On Wed, Oct 19, 2011 at 4:46 PM, Konstantin Kolinko
<kn...@gmail.com>wrote:

> 2011/10/19 Silvia Righini <sh...@gmail.com>:
> > Hi everyone,
> >
> > I'm trying to tell tomcat to use log4j for its internal logging, but it
> just
> > ignores me..
> > I have Tomcat 6.0.33 running on a Mac OS X 10.5.8 (with java openjdk
> version
> > "1.6.0-internal").
> >
> > I followed to the letter the docs at
> > http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Using_Log4j
> > I put log4j.properties (copy and paste right from the docs) in
> > /usr/local/tomcat/lib, got log4j-1.2.16.jar in /usr/local/tomcat/lib, and
> > put tomcat-juli-adapters.jar and (new) tomcat-juli.jar in
> > /usr/local/tomcat/bin.
>
> IIRC, adapters should go into lib.  They wouldn't be found if they are in
> bin.
>
> You are SO right! I read the docs over and over and didn't notice
tomcat-juli.jar had to be in bin, while the adapter had to be in lib!

Thank you so much, you saved my day!

Re: can't set tomcat to use log4j for its internal logging

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/10/19 Silvia Righini <sh...@gmail.com>:
> Hi everyone,
>
> I'm trying to tell tomcat to use log4j for its internal logging, but it just
> ignores me..
> I have Tomcat 6.0.33 running on a Mac OS X 10.5.8 (with java openjdk version
> "1.6.0-internal").
>
> I followed to the letter the docs at
> http://tomcat.apache.org/tomcat-6.0-doc/logging.html#Using_Log4j
> I put log4j.properties (copy and paste right from the docs) in
> /usr/local/tomcat/lib, got log4j-1.2.16.jar in /usr/local/tomcat/lib, and
> put tomcat-juli-adapters.jar and (new) tomcat-juli.jar in
> /usr/local/tomcat/bin.

IIRC, adapters should go into lib.  They wouldn't be found if they are in bin.


> I deleted logging.properties. As I start tomcat (through startup.sh) it
> tells me $CATALINA_HOME and $CATALINA_BASE are both set to
> /usr/local/tomcat, so I just skipped point 5 of the docs.
>
> At this point, Tomcat just logs to catalina.out.
> Whatever i put in log4j.properties just gets ignored (i changed the
> conversion pattern, and the file name of the log files and restarted tomcat,
> but no change.. tomcat logs as it always did.. and to catalina.out alone
> now).
>
> I added -Dlog4j.debug to $JAVA_OPTS in catalina.sh, but i don't get any
> output from it. I have a project on Tomcat that gets correctly deployed and
> uses log4j (with its own log4j.properties in its war/classes), and for this
> project i can see the result of -Dlog4j.debug, but nothing regarding Tomcat
> itself.
>
> This issue is driving me crazy, any hint is appreciated! :)
> Thanks
>
> Silvia
>

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