You might not even need to change the configuration if you use the "org.apache.log4j.config" package in the "log4j-1.2-api" module , which is not well documented, yet.
Gary On Wed, Nov 16, 2016 at 3:36 PM, Remko Popma <remko.po...@gmail.com> wrote: > Chris, > > Are you aware that there is a log4j-1.2-api adapter included in Log4j2 > that allows you to keep your application code unchanged (unless you rely on > the innards of Log4j 1.2)? > > You only need to change the configuration (the manual has tons of > examples). > > Just FYI. > Remko > > Sent from my iPhone > > > On 17 Nov 2016, at 7:33, Christopher Schultz < > ch...@christopherschultz.net> 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 > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org > For additional commands, e-mail: log4j-user-h...@logging.apache.org > > -- E-Mail: garydgreg...@gmail.com | ggreg...@apache.org Java Persistence with Hibernate, Second Edition <https://www.amazon.com/gp/product/1617290459/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1617290459> JUnit in Action, Second Edition <https://www.amazon.com/gp/product/1935182021/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182021> Spring Batch in Action <https://www.amazon.com/gp/product/1935182951/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%7Blink_id%7D%7D%22%3ESpring+Batch+in+Action> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=1935182951> Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory