On 11/16/16 9:49 AM, Ralph Goers wrote:
First, I have to say that Log4j 1 reached end-of-life over a year
ago. We recommend you upgrade to Log4j 2.

Fair enough. I'm not quite there, yet. I suspect that log4j 2 will have
the same issue, though.

I don’t know how to configure a TriggeringEventEvaluator in Log4j 1 but I’d bet 
google does ;-)

Chris: I have a ThrottledSMTPApppender subclass that I used for years under Log4j 1.x, it's very small but was somewhat tricky; it starts a "flusher" thread and attaches a shutdown hook to drain before exit. There is a TriggeringEventEvaluator that always returns false. There is a configureable "initialDelay" (default 10 seconds) and "messageInterval" (default 60 seconds).

I've since moved up to Log4j 2, and you are correct that Log4j 2 didn't do throttling/batching quite like I wanted, so I have a "ThrottledSMTP" Plugin for Log4j 2.

There was some discussion of this at LOG4J2-252, which is still open. I'll attach my two variants to that ticket with the hope they may be useful as-is to you or to others. However I don't have the time in foreseeable future to prepare the proper unit test and documentation that would be required to make it part of official Log4j2.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to