atom feed8 messages in ch.qos.logback-user[logback-user] Set Level per Logger A...
FromSent OnAttachments
Robert ElliotOct 30, 2008 5:02 am 
Ceki GulcuOct 30, 2008 6:24 am 
Robert ElliotOct 30, 2008 6:31 am 
Ceki GulcuOct 30, 2008 6:51 am 
Robert ElliotOct 30, 2008 6:59 am 
Ceki GulcuOct 30, 2008 7:36 am 
Robert ElliotOct 31, 2008 7:29 am 
Robert ElliotOct 31, 2008 7:29 am 
Subject:[logback-user] Set Level per Logger AND Appender?
From:Ceki Gulcu (lis@qos.ch)
Date:Oct 30, 2008 6:51:19 am
List:ch.qos.logback-user

I see. You could attach an evaluator fiter which can filter events based on criteria that you decide upon. For example,

<filter class="ch.qos.logback.core.filter.EvaluatorFilter"> <evaluator name="myEval"> <expression> (logger.getName().contains("logger names...") && level > INFO) || (level > WARN) </expression> </evaluator> <OnMismatch>DENY</OnMismatch> <OnMatch>ACCEPT</OnMatch> </filter>

where "logger names ..." stands for loggers needing special handling.

I am not 100% the above expression is error free but it should at least get my point across. In particular, you need to write & as &amp; in an XML file. So '&&' would become '&amp;&amp;'.

Does the above help?

Robert Elliot wrote:

Because for some loggers I want INFO level statements to be written to application.log (for instance in the case of server startup / shutdown) and for some loggers I don't. If I set a filter on the appender to only allow WARN or higher to application.log I lose all the INFO statements I wanted- if I set it to allow INFO or higher then if I set a logger to DEBUG then it will start sending INFO messages that I don't want to application.log.