Hi,

I have question about ch.qos.logback.classic.Logger#isXXXEnable() methods implementations, it seems that for FilterReply.NEUTRAL decision, it simply always return false if effective level is above DEBUG level.

public boolean isInfoEnabled() {
    FilterReply decision = callTurboFilters(Level.INFO);
    if (decision == FilterReply.NEUTRAL) {
      return effectiveLevelInt <= Level.DEBUG_INT;   // always false, same for isErrorEnabled()
    } else if (decision == FilterReply.DENY) {
      return false;
    } else if (decision == FilterReply.ACCEPT) {
      return true;
    } else {
      throw new IllegalStateException("Unknown FilterReply value: " + decision);
    }
  }

This implementations causes, that configuration below do not print INFO messages:

<configuration>

    <!--====================================================================
      appenders
    =====================================================================-->
   
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">   
        <layout class="ch.qos.logback.classic.PatternLayout">
            <Pattern>%d{HH:mm:ss.SSS} - [%thread] [%c:%line] %-5level - %msg %n</Pattern>
        </layout>
    </appender>

    <!--====================================================================
      loggers
    =====================================================================-->

    <logger name="org.apache">
        <level value="INFO"/>
    </logger>

    <logger name="org.springframework">
        <level value="INFO"/>
    </logger>

    <!--====================================================================
      root logger
    =====================================================================-->

    <root>
        <level value="INFO" />
        <appender-ref ref="STDOUT"/>
    </root>

</configuration>
_______________________________________________
user mailing list
[email protected]
http://www.slf4j.org/mailman/listinfo/user

Reply via email to