[logback-user] logging output duplicated

Chris Cheshire cheshirator at gmail.com
Tue Dec 2 01:45:49 CET 2008


Thanks Ceki, this all helps :)


On Mon, Dec 1, 2008 at 11:56 AM, Ceki Gulcu <ceki at qos.ch> wrote:
>
>
> Chris Cheshire wrote:
>> Ceki,
>>
>> What I want is only ERROR logging from the external libraries (eg
>> Stripes), while having DEBUG from my own.
>
> In that case, you need to write
>
>  <root level="ERROR">
>    <appender-ref ref="EMAIL" />
>    <appender-ref ref="FILE"  />
>  </root>
>
>  <logger name="package.of.for.your.own.code" level="DEBUG"/>
>
>> Do I need to define it as :
>>
>> <root level="ERROR">
>>   <appender-ref ref="EMAIL" />
>> </root>
>>
>> <logger name="foo" level="DEBUG" additivity="false">
>>   <appender-ref ref="EMAIL" />
>>   <appender-ref ref="FILE"  />
>> </logger>
>>
>>
>> Regarding the additivity, why are INFO messages being logged by the
>> root logger when its threshold is ERROR? Shouldn't it just be ERROR
>> getting picked up by that section, even with the additivity on?
>
> The level setting for the root logger is inherited. When you set the level of
> the "foo" loggger to DEBUG, you override the level setting of the root logger.
>
> This is explained in the manual
>
>   http://logback.qos.ch/manual/architecture.html#basic_selection
>
> HTH,
> --
> Ceki Gülcü
> Logback: The reliable, generic, fast and flexible logging framework for Java.
> http://logback.qos.ch
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user
>


More information about the Logback-user mailing list