Why is Log4j rootLogger not filtering log events according to event level?

Posted by Derek Mahar on Stack Overflow See other posts from Stack Overflow or by Derek Mahar
Published on 2010-06-11T14:39:28Z Indexed on 2010/06/11 14:43 UTC
Read the original article Hit count: 301

Filed under:
|
|

Why is the Log4j rootLogger in my application not filtering log events according to level? In my log4j.properties, I have several loggers:

log4j.rootLogger=info,stdout
log4j.logger.com.name.myapp=debug,myapp
log4j.logger.org.castor=debug,castor
log4j.logger.org.exolab.castor=debug,castor
log4j.logger.org.hibernate=debug,hibernate
log4j.logger.org.springframework=debug,spring

Each of the loggers receive and record numerous log events at levels DEBUG and above, which is what I expect. The rootLogger, however, despite being set to level INFO, is displaying all of these events, too, including the DEBUG events, which is not what I expect. Instead, I would expect it to filter the DEBUG events, but display only the events at level INFO and higher (WARN, ERROR, and FATAL). Why is rootLogger displaying all of the events?

© Stack Overflow or respective owner

Related posts about java

Related posts about logging