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: [EMAIL PROTECTED]
Phone: +39 051 6171 775

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to