On Wed, 7 May 2008, Bill Moseley wrote:

> What I'm after is to have an email sent *as soon* as an error is
> detected.  But, then to collect any more errors for a few minutes
> before sending another email again to keep from flooding with email.
> (I also want to report to Nagios, but that's later.)
> Log::Dispatch::Email has a "buffered" option but I'm not sure that
> fits with the above.  Any existing solutions for the above?

The way this works in the buffered email appender is actually quite
different: It collects messages *until* a threshold is reached, then it
sends an email:

  http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#a0f6e

> What I'm attempting to do instead is have a separate File appender
> that only logs ERROR and above to a file, then watch that file.

If you're running a single process (and won't need to keep state on
restarts) there's no need to do this in a file appender. You could
define your own appender which maintains a (memory) buffer.

> So I have these settings for my appender:
>
>     .recreate = 1
>     .recreate_check_interval = 0
>
> But, that is not working -- the move is not detected.

Aha, that's a bug -- I've fixed it in 1.16 in CVS, to be released soon
-- thanks!

> Finally, another question.  I've got three appenders.  One for syslog,
> one for stderr, and one to a file.
>
> Is it possible to set a pattern that will apply to all?  Or do I have
> to specify a pattern for each appender?

Variable substitution should help with this:

   http://log4perl.sourceforge.net/d/Log/Log4perl.html#bd632

-- Mike

Mike Schilli
[EMAIL PROTECTED]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
log4perl-devel mailing list
log4perl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/log4perl-devel

Reply via email to