[slf4j-user] JUL Bridging

Marshall Pierce marshall at mpierce.org
Wed Dec 14 04:20:45 CET 2011


I'm using the RestFB library for Facebook API access, and it uses java.util.logging loggers. I've attempted to configure slf4j - JUL bridging, but I'm still seeing INFO statements logged on stdout, such as this one from RestFB's DefaultWebRequestor:

    if (logger.isLoggable(INFO))
      logger.info("Making a GET request to " + url);

with output

Dec 14, 2011 2:16:31 AM com.restfb.DefaultWebRequestor executeGet
INFO: Making a GET request to ...

The first line of my main method that boots up my app is:

        SLF4JBridgeHandler.install();

and I'm using Logback, with the following snippet of config:

<configuration>
  <jmxConfigurator/>
  <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/>

  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>%d [%thread] %-5level MDC[%X] %logger{36} - %msg%n</pattern>
    </encoder>
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>WARN</level>
    </filter>
  </appender>

The rest of the config is specific class log level adjustments and another debug-level file appender, nothing fancy.

However, I'm seeing those "Making a GET request to "… log lines in both the log file (which is correct!) and stdout (which is not). The offending log lines on stdout are not of Logback's configured format.

Am I doing anything obviously wrong? If not, any ideas on where to debug?

Thanks,
Marshall


More information about the slf4j-user mailing list