[logback-user] logging output duplicated

Chris Cheshire cheshirator at gmail.com
Sun Nov 30 20:23:43 CET 2008


In my webapp I am trying to send emails only on errors, with
everything else logged to a file. I am using logback under slf4j, with
the log4j/slf4j bridge for the external libraries that normally use
log4j.

My configuration file is reloaded in the servlet context init (using
the Joran configurator example from the documentation) so I can set
some system properties used in the appenders (like the context name).

The logging config has :

  <root level="ERROR">
    <appender-ref ref="EMAIL" />
    <appender-ref ref="FILE" />
  </root>

  <logger name="foo" level="DEBUG">
      <appender-ref ref="FILE" />
  </logger>


*Everything* not of log level ERROR coming from foo is getting logged
twice. Why? I've pored over Chapter 2 of the documentation and it
seems to describe the opposite of what is happening. The level for foo
will ideally swap between DEBUG and INFO, but I can't have things
logged twice all the time. How do I fix this?

Thanks

Chris


More information about the Logback-user mailing list