commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kerrigan, Seamus" <Seamus.Kerri...@FMR.COM>
Subject RE: using commons-logging in webapp w/ log4j, can't find my properties
Date Sun, 15 Oct 2006 00:42:17 GMT
Hi Jason,
Perhaps you could call
org.apache.commons.logging.LogFactory.release(java.lang.ClassLoader) to
release any previously created LogFactory references associated with the
classloader. The next call to LogFactory.getLog() should force
commons-logging to rediscover the logging implementation.

Regards,
Seamus

-----Original Message-----
From: Jason Novotny [mailto:novotny@gridsphere.org] 
Sent: Saturday, October 14, 2006 8:50 PM
To: Jakarta Commons Users List
Subject: Re: using commons-logging in webapp w/ log4j, can't find my
properties



    I think I see my problem--

My webapp first invokes a set of classes that are located in the 
shared/lib classpath of Tomcat. Those classes also use commons-logging, 
however there is no commons-logging jar in shared/lib alongside them, My

hunch is they make use of the commons-logging.jar located in Tomcat/bin 
directory that ships with tomcat. Then it would seem that when execution

returns to my webapp, Tomcat classloading magic will just continue to 
use the default logging properties and not my log4j.properties file.

    I can manually make it all work just by doing

PropertyConfigurator.configure(config.getServletContext().getRealPath("/
WEB-INF/classes/log4j.properties"));

at the top of my servlet, so I guess this appears to the best solution 
for now.

    Jason


Dennis Lundberg wrote:
> I'd suggest that you take a look at the troubleshooting guide for 
> commons-logging, especially the section on how to turn on "Diagnostic 
> logging":
>
>
http://jakarta.apache.org/commons/logging/troubleshooting.html#Using_JCL
_Diagnostics 
>
>
> That will show you what commons-logging is up to and where it finds 
> its configuration.
>


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


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


Mime
View raw message