logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remko Popma <remko.po...@gmail.com>
Subject Re: [log4j 1.x] Batch-sending with SMTPAppender
Date Wed, 30 Nov 2016 22:26:08 GMT
Chris,

Glad to hear that. 

Be aware that Log4j 1 is broken in Java 9 so you will need to go to Log4j 2 when you upgrade
Java. 

Remko

Sent from my iPhone

> On 1 Dec 2016, at 1:41, Christopher Schultz <chris@christopherschultz.net> wrote:
> 
> All,
> 
> On 11/17/16 10:28 AM, Christopher Schultz wrote:
>>> So, I implemented an event trigger class in my driver class like this:
>>> 
>>> package com.my;
>>> public class Driver
>>> {
>>>    [...]
>>>    public static class NeverTriggeringEventEvaluator
>>>        implements TriggeringEventEvaluator
>>>    {
>>>        @Override
>>>        public boolean isTriggeringEvent(LoggingEvent arg0) {
>>>            return false;
>>>        }
>>>    }
>>> }
>>> 
>>> I enabled it in my configuration file like this:
>>> 
>>> log4j.appender.CLIENT.evaluatorClass=com.my.Driver$NeverTriggeringEventEvaluator
> 
> When using this NeverTriggeringEventEvaluator, I'm getting the behavior
> I want: all of my error messages are being sent in a single email message.
> 
> Thanks to all involved.
> 
> I may update it to be sensitive to the number of logging events so that
> it never actually loses events. Right now, I believe if I hit 501
> events, I'll lose one in the message that is sent when the appender is
> shut-down.
> 
> -chris
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message