sub cb($$$) { my ($disp, $options, $reason, $message) = @_; ... } dispatcher Log::Report::Dispatcher::Callback => 'cb' , callback => \&cb; dispatcher CALLBACK => 'cb' # same , callback => \&cb;
See SYNOPSIS in Log::Report::Dispatcher
This basic file logger accepts a callback, which is called for each message which is to be logged. When you need complex things, you may best make your own extension to Log::Report::Dispatcher, but for simple things this will do.
See DESCRIPTION in Log::Report::Dispatcher
sub send_mail($$$) { my ($disp, $options, $reason, $message) = @_; my $msg = Mail::Send->new(Subject => $reason , To => 'admin@localhost'); my $fh = $msg->open('sendmail'); print $fh $disp->translate($reason, $message); close $fh; } dispatcher CALLBACK => 'mail', callback => \&send_mail;
See Available back-ends in Log::Report::Dispatcher
See Addition information in Log::Report::Dispatcher
See Filters in Log::Report::Dispatcher