Patch: Configure Syslog-Facility

Hi! just a small hack to configure the Syslog-Facility in Config.pm feel free to improve it. --- Kernel/System/Log/SysLog.pm.orig 2004-04-23 09:46:22.000000000 +0200 +++ Kernel/System/Log/SysLog.pm 2004-04-23 10:02:07.000000000 +0200 @@ -27,6 +27,9 @@ my $Self = {}; bless ($Self, $Type); + $Self->{SysLogFacility} = $Param{ConfigObject}->Get('LogModule::SysLog::Facility') + || 'user'; + return $Self; } # -- @@ -37,7 +40,7 @@ # start syslog connect # -- setlogsock('unix'); - openlog($Param{LogPrefix}, 'cons,pid', 'user'); + openlog($Param{LogPrefix}, 'cons,pid', $Self->{SysLogFacility}); if ($Param{Priority} =~ /debug/i) { syslog('debug', "[Debug][$Param{Module}][$Param{Line}] $Param{Message}"); -- Jörg Friedrich

Hi Jörg, thanks, I added it to the CVS. :) -Martini On Fri, Apr 23, 2004 at 10:04:08AM +0200, Joerg Friedrich wrote:
Hi! just a small hack to configure the Syslog-Facility in Config.pm feel free to improve it.
--- Kernel/System/Log/SysLog.pm.orig 2004-04-23 09:46:22.000000000 +0200 +++ Kernel/System/Log/SysLog.pm 2004-04-23 10:02:07.000000000 +0200 @@ -27,6 +27,9 @@ my $Self = {}; bless ($Self, $Type);
+ $Self->{SysLogFacility} = $Param{ConfigObject}->Get('LogModule::SysLog::Facility') + || 'user'; + return $Self; } # -- @@ -37,7 +40,7 @@ # start syslog connect # -- setlogsock('unix'); - openlog($Param{LogPrefix}, 'cons,pid', 'user'); + openlog($Param{LogPrefix}, 'cons,pid', $Self->{SysLogFacility});
if ($Param{Priority} =~ /debug/i) { syslog('debug', "[Debug][$Param{Module}][$Param{Line}] $Param{Message}");
-- Jörg Friedrich _______________________________________________

Martin Edenhofer schrieb am Montag, 26. April 2004 um 14:27:26 +0200:
thanks, I added it to the CVS. :)
btw, I set SysLogFacility to user as fallback, maybe there should be an example in Defaults.pm
-Martini
On Fri, Apr 23, 2004 at 10:04:08AM +0200, Joerg Friedrich wrote:
Hi! just a small hack to configure the Syslog-Facility in Config.pm feel free to improve it.
--- Kernel/System/Log/SysLog.pm.orig 2004-04-23 09:46:22.000000000 +0200 +++ Kernel/System/Log/SysLog.pm 2004-04-23 10:02:07.000000000 +0200 @@ -27,6 +27,9 @@ my $Self = {}; bless ($Self, $Type);
+ $Self->{SysLogFacility} = $Param{ConfigObject}->Get('LogModule::SysLog::Facility') + || 'user'; + return $Self; } # -- @@ -37,7 +40,7 @@ # start syslog connect # -- setlogsock('unix'); - openlog($Param{LogPrefix}, 'cons,pid', 'user'); + openlog($Param{LogPrefix}, 'cons,pid', $Self->{SysLogFacility});
if ($Param{Priority} =~ /debug/i) { syslog('debug', "[Debug][$Param{Module}][$Param{Line}] $Param{Message}");
-- Jörg Friedrich _______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
-- Jörg Friedrich

On Mon, Apr 26, 2004 at 03:50:12PM +0200, Joerg Friedrich wrote:
Martin Edenhofer schrieb am Montag, 26. April 2004 um 14:27:26 +0200:
thanks, I added it to the CVS. :)
btw, I set SysLogFacility to user as fallback, maybe there should be an example in Defaults.pm
Yes. :) [Kernel/Config/Defaults.pm] # param for LogModule Kernel::System::Log::SysLog $Self->{'LogModule::SysLog::Facility'} = 'user'; [...] But it's not in the CVS yet (next check in). Thanks for your help! :) Martin -- ((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!
participants (2)
-
Joerg Friedrich
-
Martin Edenhofer