From 3f0e9f963de690115ac11135abe285b7b580f4ce Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 14 Dec 2005 18:25:23 +0000 Subject: [PATCH] escaping embedded %'s so syslog won't barf git-svn-id: svn://svn.open-ils.org/ILS/trunk@2379 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- OpenSRF/src/perlmods/OpenSRF/Utils/Logger.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenSRF/src/perlmods/OpenSRF/Utils/Logger.pm b/OpenSRF/src/perlmods/OpenSRF/Utils/Logger.pm index dcc0c580a3..53e2990838 100644 --- a/OpenSRF/src/perlmods/OpenSRF/Utils/Logger.pm +++ b/OpenSRF/src/perlmods/OpenSRF/Utils/Logger.pm @@ -203,14 +203,17 @@ sub _log_message { #my( $pack, $file, $line_no ) = @caller; + # help syslog with the formatting + $msg =~ s/\%/\%\%/gso if( is_act_syslog() or is_syslog() ); + $msg = "[$n:"."$$".":::] $msg"; if( $level == ACTIVITY() ) { - if( is_act_syslog() ) { syslog( $fac | $l, substr($msg,0,100) ); } + if( is_act_syslog() ) { syslog( $fac | $l, $msg ); } elsif( is_act_filelog() ) { _write_file( $msg, 1 ); } } else { - if( is_syslog() ) { syslog( $fac | $l, substr($msg,0,100) ); } + if( is_syslog() ) { syslog( $fac | $l, $msg ); } elsif( is_filelog() ) { _write_file($msg); } } } -- 2.43.2