From 9c0da486aa1b4237da189127220ba72ce3d49d65 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 12 Aug 2008 17:21:08 +0000 Subject: [PATCH] -Change MsgUtils function to not fork logger git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2015 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/MsgUtils.pm | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/perl-xCAT/xCAT/MsgUtils.pm b/perl-xCAT/xCAT/MsgUtils.pm index d23fad0e3..22cade65f 100644 --- a/perl-xCAT/xCAT/MsgUtils.pm +++ b/perl-xCAT/xCAT/MsgUtils.pm @@ -4,7 +4,7 @@ package xCAT::MsgUtils; use strict; -use Sys::Syslog; +use Sys::Syslog qw (:DEFAULT setlogsock); #use locale; use Socket; use File::Path; @@ -280,16 +280,15 @@ sub message # If they want this msg to also go to syslog, do that now eval { - #openlog("xCAT", '', 'local4'); - #syslog("err", $rsp); - #closelog(); - # switched to logger due to hangs using Perl interface - # when syslog not running - `logger -p local4.err -t xcat $rsp`; - if ( $? != 0) { - print $stdouterrf "Error using Syslog\n"; - } + openlog("xCAT", '', 'local4'); + setlogsock(["tcp","unix","stream"]); + syslog("err", $rsp); + closelog(); }; + my $errstr = $@; + if ($errstr) { + print $stdouterrf "Unable to log $rsp to syslog because of $errstr\n"; + } } } return;