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>
  | 

I've changed the snoop.jsp as follows:

  | private Log myLog = LogFactory.getLog("foo");
  | .... // log4j Logger log already defined in file
  | log.debug("log4j.debug");
  | myLog.debug("commons-logging.debug");
  | 

I see the log4j statement printed to the console, but not the commons-logging 
one.

Is there any way around this? According to the JIRA issue that this relates to 
it seems that 4.0.2 simply ignores any commons-logging jars in the webapp's lib 
dir. Does this mean that it's using a jar from JBoss or Tomcat's classloader, 
which is in turn using a log4j library in the same scope?

Thanks for any assistance.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3876340#3876340

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3876340


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to