You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Affan Qureshi <qu...@etilize.com> on 2003/04/09 14:59:23 UTC

Logging control in Tomcat

Hi,
Same old question about logging.... I searched through the archive and found
many useful pointers but none to answer this.

I have Tomcat 4.1.18 (and Struts1.1b2) on Win2000 using JDK1.4. I want to
use log4J under commons-logging. I have commons-logging.jar and log4j.jar in
my WEB-INF/lib and commons-logging.properties and log4j.properties in
WEB-INF/classes.

The problem is that all the default messages of Tomcat/Struts start to
appear in my log file instead of catalina.out or the console. I read that I
shouldn't place log4j.jar in my WEB-INF/lib but without that commons-logging
does not initialize log4j correctly and picks up Jdk14Logger instead
(although the
o.a.c.l.LogFactory.getFactory().getAttribute("org.apache.commons.logging.Log
") shows correct class but it is not found). I have also tried to put
log4j.jar in tomcat's server/lib but no improvement. Has anyone implemented
under the same parameters?

2nd question, I want to programmatically configure the location of my log
file (via the app. admin interface on startup). But I think it is difficult
to do so when hiding the implementation behind common-logging. Also I want
the log-level and some other attribute configurable via the admin interface.
Any suggestions?

3rd question, how do I change the default log level (or for my app context)
in Tomcat? I tried setting it in struts-config.xml but did not make a
difference. Something in conf/server.xml i think?

Thanks a lot.

Affan


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