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 Thu, 01 Dec 2016 03:41:29 GMT
Details are here:
https://blogs.apache.org/logging/entry/moving_on_to_log4j_2

Sent from my iPhone

> On 1 Dec 2016, at 10:32, Christopher Schultz <chris@christopherschultz.net> wrote:
> 
> Remko,
> 
>> On 11/30/16 5:26 PM, Remko Popma wrote:
>> 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.
> 
> I'm curious... in what way is log4j 1.x broken in Java 9?
> 
> I've been meaning to switch to log4j 2.x for a number of years, but
> since it ain't broke :)  ... until now, I guess.
> 
> Thanks,
> -chris
> 
>>> 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
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message