[logback-user] [SPAM] - Question - Email found in subject

Lucas, Casey clucas at e-miles.com
Tue Jun 2 17:01:49 CEST 2009


We use the token bucket filter for exactly this purpose.

https://issues.apache.org/bugzilla/show_bug.cgi?id=45753

We adapted Chad LaVigne's to use for logback and it works well.  IMO, a TokenBucketFilter should ship with logback.

snipit from one of our xml configs:

    <appender name="EMAIL"  class="com.emiles.util.log.logback.ReverseSMTPAppender">
        <BufferSize>128</BufferSize>
        <SMTPHost>...</SMTPHost>
        <From>...</From>
        <To>...</To>
        <Subject>... %p %m%nopex</Subject>
        <Evaluator class="com.emiles.util.log.logback.TokenBucketEvaluator">
            <TokenFillAmount>2</TokenFillAmount>
            <TokenFillInterval>300</TokenFillInterval>
            <MaxTokens>20</MaxTokens>
            <LogLevel>ERROR</LogLevel>
        </Evaluator>


this will allow a burst of 20 emails followed by a gradual build up of letting 2 more through every 5 minutes.

-casey


-----Original Message-----
From: logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] On Behalf Of Louie Liu
Sent: Monday, June 01, 2009 11:13 PM
To: logback-user at qos.ch
Subject: [SPAM] - [logback-user] Question - Email found in subject


We have the following use case and would like to know what is the best practice in logback framework.

Basically, we are trying to use the SMTP logger appender to send alert email when the erorr is occured.  The issue is that we would like to generate a summary messages (which including, for example, about 100 errors which occured within the given time frame) and send only one email.  The reason for it is to reduce the number of email to avoid flush the email server. 

Please let us know what is the best way to configure the logback to satisfy the use case above.

Thanks a lot.

Louie 



      
_______________________________________________
Logback-user mailing list
Logback-user at qos.ch
http://qos.ch/mailman/listinfo/logback-user
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TokenBucketEvaluator.java
Type: application/octet-stream
Size: 4591 bytes
Desc: TokenBucketEvaluator.java
URL: <http://qos.ch/pipermail/logback-user/attachments/20090602/f1ee83a8/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TokenBucket.java
Type: application/octet-stream
Size: 2808 bytes
Desc: TokenBucket.java
URL: <http://qos.ch/pipermail/logback-user/attachments/20090602/f1ee83a8/attachment-0001.obj>


More information about the Logback-user mailing list