| Log-Dispatch-Binlog documentation | Contained in the Log-Dispatch-Binlog distribution. |
Log::Dispatch::Binlog::File - A subclass of Log::Dispatch::File that logs with Storable.
use Log::Dispatch::Binlog::File; my $output Log::Dispatch::Binlog::File->new( # Log::Dispatch::File options go here );
Instead of printing messages this will store all of the params to
log_dispatch using nstore_fd in Storable.
| Log-Dispatch-Binlog documentation | Contained in the Log-Dispatch-Binlog distribution. |
#!/usr/bin/perl package Log::Dispatch::Binlog::File; use strict; use base qw( Log::Dispatch::File Log::Dispatch::Binlog::Base ); sub log_message { my ( $self, %p ) = @_; my $fh; if ( $self->{close} ) { $self->_open_file; $fh = $self->{fh}; $self->_storable_print( $fh, \%p ) or die "Cannot write to '$self->{filename}': $!"; close $fh or die "Cannot close '$self->{filename}': $!"; } else { $fh = $self->{fh}; $self->_storable_print( $fh, \%p ) or die "Cannot write to '$self->{filename}': $!"; } } __PACKAGE__ __END__