I've been waiting for the release of 4.0.2 hoping that it would solve a problem that I'm having that is similar to this thread. I'm trying to use commons-logging with log4j using my own log4j.xml config file, but JBoss (or Tomcat?) doesn't seem to want to cooperate.
I've set up a scoped class loader as detailed on the logging wiki page, and have downloaded the sample log4j.war file. It works fine, but it uses log4j directly. Grrr, not what I'd like...
Here's portion of the log4j.xml file I have working in the log4j.war app:
<appender name="STDOUT" class="org.apache.log4j.ConsoleAppender"> <param name="Target" value="System.out"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c:%L - %m%n"/> </layout> </appender> <root> <priority value="debug"/> <appender-ref ref="STDOUT"/> </root>
private Log myLog = LogFactory.getLog("foo"); .... // log4j Logger log already defined in file log.debug("log4j.debug"); myLog.debug("commons-logging.debug");