commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jakarta-commons Wiki] Update of "Logging/FrequentlyAskedQuestions" by SeamusKerrigan
Date Wed, 08 Nov 2006 10:40:56 GMT
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/ReadMsg?listName=commons-user@jakarta.apache.org&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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message