commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesus M. Salvo Jr." <jesus.sa...@migasia.com>
Subject [Commons-Logging] Using Commons-Logging with an older Log4J ( 1.1.3 )
Date Tue, 03 Jun 2003 07:52:53 GMT

I am using Commons-Logging against Log4J 1.1.3

I use Commons-Logging like this:

*) via System properties:
-Dlog4j.configuration=/export/softgame/app_gateway/prod/test/log4j.properties
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog

*) within source code:
    Log     logger = LogFactory.getLog( "SMimeFetcher" );

I presume that the String passed in becomes the category name in Log4J.
The calls to info() does get outputted via Log4J, ... but they all get 
logged to Log4J's root category!

Interestingly though, I looked at the source code for 
org.apache.commons.logging.impl.Log4JCategoryLog, and there is no 
reference to Log4J's Category class, but instead it references Log4J's 
Logger class.

However, Log4J 1.1.3 did not yet have Log4J's Logger class. In short, I 
would have expected it to NOT work, but it still did.


Anyway ... is there any other alternative to reliably using 
Commons-Logging against Log4J apart from upgrading to the latest Log4J?






Mime
View raw message