Skip Menu |

This queue is for tickets about the Log-Log4perl CPAN distribution.

Report information
The Basics
Id: 80086
Status: resolved
Priority: 0/
Queue: Log-Log4perl

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.37
Fixed in: (no value)



Subject: Log::Log4perl::Appender::Limit doesn't group messages in mail appender
When using the example provided in the SYNOPSIS, 3 emails are sent, whereas 2 should be. The second message should contain log messages 2 and 3, but that is not the case. I can't make it behave according to the documentation whatever settings I try (buffering on or off, various combinations of logger config, etc.) Maybe just a working example with a proper set of parameters would be enough, but the example in the POD (or the code...) needs a fix.
Le Mar 09 Oct 2012 18:42:53, david.morel@amakuru.net a écrit : [...] Show quoted text
> Maybe just a working example with a proper set of parameters would be > enough, but the > example in the POD (or the code...) needs a fix.
to have it work (nearly) like I wanted, I had to subclass the module, set buffering to 1 in the email appender, and in the calling code, do this ugly thing: sub flush { my($self) = @_; $self->SUPER::flush(@_); $self->{app}->flush; # Send the email! } Which is clearly very wrong.
I of course meant: sub flush { my $self = shift; $self->SUPER::flush(@_); $self->{app}->flush; # Send the email! }
Good point, I've fixed the docs and added a parameter "appender_method_on_flush" to (hopefully) support what you're looking for. Let me know how it works for you. https://github.com/mschilli/log4perl/commit/4921af5df0f118021228c4a620fe 5f902e0e083a -- Mike