[logback-user] SMTPAppender with multiple evaluators

Naor Yuval n.yuval at itpcorporation.com
Wed Apr 7 17:47:55 CEST 2010

Thanks for the quick answer.

-----Original Message-----
From: logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] On Behalf Of Ceki Gülcü
Sent: Tuesday, April 06, 2010 5:34 PM
To: logback users list
Subject: Re: [logback-user] SMTPAppender with multiple evaluators

Hello Naor,

It seems to me that a single evaluator could almost do the job:

- if exception type for the current event is A0 or A1 and counter == 0
then return true (trigger outgoing email), increment the counter, set
next = now+1hour

- if exception type for the current event is A0 or A1 and counter !=
0, and next < now, return true (trigger outgoing email), set next =

- if exception type other than A0 or A1, return true

- otherwise return false

Evaluators can only act as an email trigger, they can't influence the
contents of the outgoing email. The point is that an evaluator is free
to use any logical criteria to whether to trigger outgoing email or


On 06/04/2010 7:34 PM, Naor Yuval wrote:
> Hi.
> I am looking to implement an SmtpAppender that will allow to specify
> "delivery rules" based on the evaluation of the error-log.
> For example, for some specific exceptions we wish to send the first
> occurrence, then buffer the rest and send a digest every hour.
> For other specific exception types we wish to send each log immediately
> What is the recommended way to implement such behavior? Could appenders
> be chained somehow to accomplish this?
> Thanks,
> Naor
Logback-user mailing list
Logback-user at qos.ch

More information about the Logback-user mailing list