If you do look at Log4j2 it would be great if you could give us feedback on what is missing for your use case. I or others can help turn things around quickly to make Log4j 2 even better.
Gary On Nov 16, 2016 2:33 PM, "Christopher Schultz" <[email protected]> wrote: > Scott, > > On 11/16/16 2:09 PM, Scott Harrington wrote: > >>> 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). > > That sounds cool, but maybe overkill if I can get the > TriggeringEventEvaluator working with the stock log4j distro. > > (It looks like I'll need to write my own NeverTriggerEventEvaluator to > do that. It looks trivial so I'll try that first.) > > > 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. > > Understood. If I (a) go down the ThrottledSMTPAppender route and (b) > move to log4j 2, I may finish-off that work. It's a long-shot, though. > > I really appreciate the feedback, though. > > -chris > >
