Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-commons Wiki" 
for change notification.

The following page has been changed by SeamusKerrigan:
http://wiki.apache.org/jakarta-commons/Logging/FrequentlyAskedQuestions

------------------------------------------------------------------------------
  
  For more information see http://mail-archives.apache.org/eyebrowse/[EMAIL 
PROTECTED]&msgNo=5737
  
+ == How Can I Use Log4j with Commons-Logging 1.1 on WebSphere 6.0? ==
+ 
+ {{{
+ I'm using WebSphere 6.0, Commons Logging 1.1 and Log4j. I have the log4j and 
commons-logging jars on my classpath, but my log4j logging is not working. Help!
+ }}}
+ 
+ WebSphere uses commons-logging and so it's in the root classloader. In 
addition, WebSphere 6.0 ships a commons-logging.properties with the following 
properties set:
+ {{{
+ 
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
+ org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
+ }}}
+ 
+ Therefore by default the application will use JDK logging and not log4j. The 
solution is to ensure that the right classloader mode is set and the 
application has an appropriate commons-logging.properties:
+ 
+ {{{
+ Set application classloader mode as PARENT_LAST. Also, add a 
commons-logging.properties to the application classpath with the following 
entries:
+ 
+ priority=1
+ 
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
+ }}}
+ 
+ The priority flag was introduced in Commons Logging 1.1 to allow an ordering 
based on priority. To ensure that an application's commons-logging.properties 
will take precedence over WebSphere's file, a priority of greater that 0.0 must 
be set. 
+ 
  == How Can I Use Commons-Logging In JBoss 4.0.2? ==
  
  {{{

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to