Subject: | Can not fallback to default join behaviour |
in config:
log4perl.appender.PsgiAPP.warp_message= MasonHandler::log_filter
$ cat app.pl
...
$log->error( { zzz => 3 }, 'Hi' );
package MasonHandler;
use Data::Dump qw/ pp /;
sub log_filter {
my @chunks = @_;
for my $msg ( @chunks ) {
$msg = pp $msg if ref $msg;
}
return join $Log::Log4perl::JOIN_MSG_ARRAY_CHAR, @chunks;
};
I know about [this](http://search.cpan.org/~mschilli/Log-Log4perl-1.46/lib/Log/Log4perl/FAQ.pm#How_can_I_drill_down_on_references_before_logging_them?)
But it is too ugly to extra type with every call:
$logger->debug( {filter => \&Data::Dumper::Dumper, value => $ref} );
instead of
$logger->debug( $ref ); with implemented 'log_filter' as above
Please let 'warp_message' do its job and do not add extra [ ] So it would not break 'layout'
It seems some discussion here:
https://www.mail-archive.com/log4perl-devel@lists.sourceforge.net/msg00025.html