0 Replies Latest reply on Nov 22, 2005 11:36 AM by Jeremie Balcaen

    JBoss with commons-loggings problem

    Jeremie Balcaen Newbie

      I try to use commons-logging in JBoss-4.0.1sp1 with log4j :

      In my web-app gsmstats, I have the jboss-web.xml file in the WEB-INF directory :

      <jboss-web>
      <class-loading java2ClassLoadingCompliance="false">
      <loader-repository>
      gsmstats:loader=gsmstats.war
      <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
      </loader-repository>
      </class-loading>
      </jboss-web>

      I have a commons-logging.properties file in WEB-INF/classes :

      org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

      I have also the log4j.properties file in WEB-INF/classes :

      log4j.logger.com.cwsoft=DEBUG, A1, dailyHtmlLog
      log4j.category.org.apache=DEBUG,A1, frameworksLog
      log4j.category.org.hibernate=DEBUG,A1, frameworksLog
      log4j.category.org.springframework=DEBUG,A1, frameworksLog
      log4j.category.com.sun.faces=DEBUG,A1, frameworksLog

      # A1 = ConsoleAppender.
      log4j.appender.A1=org.apache.log4j.ConsoleAppender
      log4j.appender.A1.layout=org.apache.log4j.PatternLayout
      log4j.appender.A1.layout.ConversionPattern=%d %r ms %-5p %c %x - %m%n
      .....

      I my application, I use the commons-logging API to print logs :

      if (LogFactory.getLog(this.getClass()).isDebugEnabled()) {
      LogFactory.getLog(this.getClass()).debug("setSubscriberServiceCommons");


      but I have no logs.

      When I use the log4j API to print logs, it works fine ! :

      if (Logger.getLogger(this.getClass()).isDebugEnabled()) {
      Logger.getLogger(this.getClass()).debug("setSubscriberServiceLog4j");
      }

      I want to use the commons-logging API.

      Is somebody have an idea of what is the problem ?