commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kerrigan, Seamus" <Seamus.Kerri...@FMR.COM>
Subject [commons-logging] JCL with log4j on WebSphere 6
Date Tue, 26 Sep 2006 14:30:43 GMT

I am trying to use JCL 1.1 with log4j in an application which is
deployed on WebSphere 6.0.2. I found that the documentation for running
JCL on WebSphere, only works on WebSphere 5 and not 6.

In WebSphere 5, the container has it's own custom implementation of
LogFactory. The documented way for an app not to use that log factory is
to set a system property for LogFactory=LogFactoryImpl and use the
PARENT_LAST classloader mode to pick up commons-logging.jar shipped with
the WAR file. This works as documented.

However, in WebSphere 6, the container itself configures LogFactoryImpl
as the factory impl and also Jdk14Logger as the log impl. If an app only
configures LogFactoryImpl, it now uses JDK logging and not log4j which
is on the app classpath. So I tried adding a
to my app classpath and configured LogFactoryImpl and Log4JLogger as the
factory and log impl classes respectively. Using JCL 1.1 diagnostics
(nice feature btw) I saw that WebSphere's
file was being loaded before the application's file, even though I was
using PARENT_LAST. I finally got it working by giving my application's
file a higher priority i.e. here is the app's


>From what I've read this is not a documented solution for WebSphere 6.
Therefore, if anyone has successfully used another approach I would be
very interested to hear. If not, then maybe this is worth adding to the
JCL documentation and I can discuss further with IBM.

BTW, what was the reason to deprecate and then remove
org.apache.commons.logging.impl.Log4jFactory as this provided a
workaround for this specific issue?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message