logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 21707] New: - Problem with <categoryFactory> in log4j.xml for LoggerFactory sub-class
Date Fri, 18 Jul 2003 12:47:07 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21707>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21707

Problem with <categoryFactory> in log4j.xml for LoggerFactory sub-class

           Summary: Problem with <categoryFactory> in log4j.xml for
                    LoggerFactory sub-class
           Product: Log4j
           Version: 1.2beta
          Platform: All
               URL: na
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Configurator
        AssignedTo: log4j-dev@jakarta.apache.org
        ReportedBy: apache-bugzilla@ueltschi.net
                CC: apache-bugzilla@ueltschi.net


Hi all,

We are using log4j 1.2.8. in our project (J2EE on WLS server). We have
sub-classed the Logger and LoggerFactory according to the examples. We are using
an XML file for configuration.

When we use <logger> or <category> (without the class attribute) and
<categoryFactory> in our log4j.xml, the DOMConfigurator is creating Logger
instances (instead of sub-classes created by our factory) during startup:

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
  <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%-5p %d{dd.MM HH:mm:ss,SSS}
%-30.30c [%m]\t%x %n"/>
    </layout>
  </appender>
  <logger name="ch.postfinance.fw.FrontController">
    <level value="INFO"/>
  </logger>
  <category name="ch.postfinance.fipo.base.AdminServlet">
    <level value="INFO"/>
  </category>
  <category name="ch.postfinance.fipo.base.FipoFrontController"
class="ch.postfinance.log.PFLogger">
    <level value="INFO"/>
  </category>
[... more categories ...]
  <root>
    <priority value ="WARN" />
    <appender-ref ref="STDOUT" />
  </root>
  <categoryFactory class="ch.postfinance.log.PFLoggerFactory"/>
</log4j:configuration>

--------------------------- Debug output: -------------------------------
     [java] log4j: Threshold ="null".
OK   [java] log4j: Desired category factory: [ch.postfinance.log.PFLoggerFactory]

BAD  [java] log4j: Retreiving an instance of org.apache.log4j.Logger.
     [java] log4j: Setting [ch.postfinance.fw.FrontController] additivity to [true].
     [java] log4j: Level value for ch.postfinance.fw.FrontController is  [INFO].
     [java] log4j: ch.postfinance.fw.FrontController level set to INFO

BAD  [java] log4j: Retreiving an instance of org.apache.log4j.Logger.
     [java] log4j: Setting [ch.postfinance.fipo.base.AdminServlet] additivity to
[true].
     [java] log4j: Level value for ch.postfinance.fipo.base.AdminServlet is  [INFO].
     [java] log4j: ch.postfinance.fipo.base.AdminServlet level set to INFO

GOOD [java] log4j: Desired logger sub-class: [ch.postfinance.log.PFLogger]
     [java] log4j: Setting [ch.postfinance.fipo.base.FipoFrontController]
additivity to [true].
     [java] log4j: Level value for ch.postfinance.fipo.base.FipoFrontController
is  [INFO].
     [java] log4j: ch.postfinance.fipo.base.FipoFrontController level set to INFO
-------------------------------------------------------------------------

BUG: (?)

Why is not the LoggerFactory sub-class specified by <categoryFactory> used to
create <logger> or <category> instances, unless we use the "class" attribute for
the category tag?

TIA and cheers,

Tom Ueltschi

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


Mime
View raw message