You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Craig Berry <Cr...@portblue.com> on 2003/08/15 23:25:17 UTC

SMTPAppender with a time limit?

I am working on a project which generates very large logs.  Currently,
we spot major problems by running a cron job which periodically greps
the most recent part of the logfile for WARN or more serious entries,
bundles them up in an email, and sends them out.  This is CPU-intensive
and otherwise unsatisfactory, however.

I proposed using SMTPAppender to do this instead.  Collecting a group of
errors before sending them out is trivial using BufferSize or a
TriggeringEventEvaluator.  What I can't figure out how to do is to send
off an email if some amount of time has gone by with events waiting to
be sent. That is, if I get a single ERROR log entry, I don't want to
send it right away; better to wait to accumulate others if there are
going to be a bunch of them, rather than sending dozens of separate
emails, one per ERROR.  But if I get a single ERROR and then nothing for
(say) five minutes, I want to go ahead and send the email, because the
admin needs to know about that one error.

I can't imagine I'm the only one who's needed such behavior.  Any tips
on how to make it happen?

-- 
Craig Berry
Principal Architect and Technical Manager
PortBlue
(310) 566-7546
 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org