Hello Lance,

Sounds like an experience to avoid. :-) Thank you for sharing your
thoughts with us.

I think the simplest way to avoid being swamped by a flood of error
reports is to place a leaky bucket in front of the
SMTPAppender. Basically, you don't need an external process to close
down the gates in case of a flood. SMTPAppender can handle this
itself.

Cheers,


At 12:59 AM 11/24/2004, L Nehring wrote:
I've worked out a simple extension to the SMTPAppender and I'm wondering if it's worth contributing back to log4j and how one might do that. I named the class "GatedSMTPAppender" (in a separate namespace). By default it doesn't send email based on logging events. An external process can get a reference to the appender by looking it up through the root logger and then invoking a method which sends and email of all events in the circular buffer. I wrote a very small JBoss service using the JBoss scheduler class that works very well for this in a JBoss environment.

Effectively this lets me have log4j events emailed out on a timed basis. I use an initial setting of 15 minutes for the JBoss service.
What prompted me to do this was an experience I had recently where other developers released code onto a JBoss server that I monitor. They broke the installation which resulted in an "ERROR" level message getting emailed to me every 5 to 10 seconds for a span about 3 days while I was on vacation. I'm embarrassed to say that I had to clean out a little over 40,000 emails from my Inbox when I returned to work. Queuing that amount of log events into emails that get sent every 15 minutes or so is something I can better handle. If the circular buffer wraps around due to an overload, so be it - the email is just a "heads up" anyway that something needs attention.


Does this sound worthwhile enough to contribute back?

Best regards,
Lance
http://www.newparticles.com/


-- Ceki G�lc�

The complete log4j manual: http://qos.ch/eclm
Professional log4j support: http://qos.ch/log4jSupport




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to