logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject Re: logger.getLevel() returning null
Date Tue, 28 Sep 2004 09:22:50 GMT

The Logger.getLevel method can return null. You are probably looking for 
the Logger.getEffectiveLevel method.

http://logging.apache.org/log4j/docs/api/org/apache/log4j/Category.html#getEffectiveLevel()

At 11:14 AM 9/28/2004, you wrote:
>Hi everybody,
>using log4j1.2.8 I am facing a strange behaviour. Follows a snippet of my 
>configuration file:
>
>    <logger name="it.cineca.sia.frk.commons" additivity="false">
>      <!-- Valori ammessi: DEBUG, INFO, WARN, ERROR, FATAL, OFF, ALL -->
>      <level value="DEBUG"/>
>      <!-- Riportare uno o piu' appender verso cui indirizzare i log -->
>      <appender-ref ref="sia.frk.appender.dailyFile"/>
>    </logger>
>
>    <logger name="it.cineca.test" additivity="false">
>      <!-- Valori ammessi: DEBUG, INFO, WARN, ERROR, FATAL, OFF, ALL -->
>      <level value="DEBUG"/>
>      <!-- Riportare uno o piu' appender verso cui indirizzare i log -->
>      <appender-ref ref="sia.frk.appender.dailyFile"/>
>    </logger>
>
>    <root>
>      <appender-ref ref="sia.frk.appender.console"/>
>    </root>
>
>Let us now suppose I have a class called it.cineca.test.j2eeLog.LoggingBean.
>Well, whenever I call "Logger.getLogger(LoggingBean.class)" I get a Logger 
>instance whose inner Level instance is null!
>While whenever I call "Logger.getLogger("it.cineca.test")" everything 
>works fine.
>Why?! Any hints?
>
>Thanks in advance,
>
>--
>______________________________________________________
>Francesco Russo
>CINECA - Interuniversitary Computing Centre
>via Magnanelli, 6/3
>40033 Casalecchio di Reno (Bologna) - ITALY
>e-mail: f.russo@cineca.it
>Phone: +39 051 6171 775
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>For additional commands, e-mail: log4j-user-help@logging.apache.org

-- 
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



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


Mime
View raw message