[logback-user] SMTPAppender with multiple filters

romeara fortycoats at gmail.com
Fri Apr 12 18:19:34 CEST 2013


Hi there,

I had to scrap the filters and go with the evaluator as you had recommended:

<appender name="SQL_TRANSACTION_DELAY_EMAIL"
class="ch.qos.logback.classic.net.SMTPAppender">
        <evaluator
class="ch.qos.logback.classic.boolex.JaninoEventEvaluator">
            <expression>
                return event.getLevel().equals(Level.WARN) &&
                    event.getMessage().contains("running time (millis)");
            </expression>
        </evaluator>
....
        <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>%date {%thread} [%X{id}] [%-5level] %class.%method -
%message%n</pattern>
        </layout>
    </appender>


Thanks again for your help.


Ray.





--
View this message in context: http://logback.10977.n7.nabble.com/SMTPAppender-with-multiple-filters-tp11860p11863.html
Sent from the Users mailing list archive at Nabble.com.


More information about the Logback-user mailing list