Subject: | split up multiline messages sent to Log::Dispatch::Syslog |
The Text::SimpleTable module in Catalyst routinely generates multi-line
strings which Catalyst routinely sends to it's logging output which when
piped into Log::Dispatch::Syslog looks very messy in the end result.
This patch allows these outputs to show up reasonably in syslog logs.
Subject: | Log-Dispatch-Syslog-patch.txt |
--- Log/Dispatch/Syslog.pm 2007-03-30 12:46:06.000000000 +0100
+++ - 2007-04-26 15:01:27.000000000 +0100
@@ -74,7 +74,9 @@
my $pri = $self->_level_as_number($p{level});
Sys::Syslog::openlog($self->{ident}, $self->{logopt}, $self->{facility});
- Sys::Syslog::syslog($self->{priorities}[$pri], '%s', $p{message});
+ foreach (split /\n/,$p{message} ){
+ Sys::Syslog::syslog($self->{priorities}[$pri], '%s', $_);
+ }
Sys::Syslog::closelog;
}