Skip Menu |

This queue is for tickets about the Sys-Syslog CPAN distribution.

Report information
The Basics
Id: 19418
Status: resolved
Priority: 0/
Queue: Sys-Syslog

People
Owner: SAPER [...] cpan.org
Requestors: gll [...] inel.gov
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 0.25



Subject: Sys::Syslog on Solaris-9 not logging to local0->local7
Perl versions 5.8.6, 5.8.7, 5.8.8 Also tried Sys::Syslog version 0.13 directly form cpan.org website. OS: Solaris 9 Sys::Syslog will not log to any local0-> local7 facility. It defaults to LOG_USER instead. The messages do go to user.info. I have tried the example directly out of the documentation and it also fails to log as requested. If you take the example from the documentation and convert it to a small C program, it does behave as expected. For my application, I need to log to LOG_LOCAL0 cat << \EOF > tst.c #include <syslog.h> #include <stdio.h> main() { syslog ( LOG_LOCAL0 | LOG_INFO , "Test Syslog LOG_LOCAL0 | LOG_INFO from C"); } EOF cat << \EOF > tst.pl #!/usr/local/bin/perl -w use Sys::Syslog; syslog("local0|info", "Test Sys::Syslog from info.local0"); EOF cat << EOF My entry from C program -> local0.info May 22 11:27:46 moran a.out[17310]: [ID 632322 local0.info] Test Syslog LOG_LOCAL0 | LOG_INFO from C My entry from Sys::Syslog went to user (/var/log/userlog per my syslog.conf) May 22 11:31:18 moran <134>May 22 11:31:18 Test Sys: :Syslog from info.local0 EOF
Subject: Re: [rt.cpan.org #19418] Sys::Syslog on Solaris-9 not logging to local0->local7
Date: Tue, 23 May 2006 01:50:07 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Hello, Show quoted text
> Sys::Syslog will not log to any local0-> local7 facility. It defaults > to LOG_USER instead. The messages do go to user.info. I have tried the > example directly out of the documentation and it also fails to log as > requested. > > If you take the example from the documentation and convert it to a > small > C program, it does behave as expected.
Just tested the examples you pasted here: they both worked for me and the messages were directed to the local0 facility. I think the problem is not in Perl, but in your syslog daemon configuration. I bet that it mangles TCP or UDP syslog messages and converts them to the user facility (the C program uses the syslog(3) function, while the Perl program sends the syslog messages via TCP, UDP or Unix socket, using the first mechanism that works). For the records, Alan Burlison is a Sun engineer in charge of packaging Perl in Solaris and he checked that Sys::Syslog worked as expected on Solaris. See tickets #16980 and #17723. Sébastien Aperghis-Tramoni -- - --- -- - -- - --- -- - --- -- - --[ http://maddingue.org ] Close the world, txEn eht nepO
From: Billy Nadeau <bill [...] cpan.org>
I had the same problem and after much debugging got some more information: I used Sys::Syslog versions 0.06 and 0.15 with perl 5.8.7 on Solaris 10 If syslogd's configured to listen on UDP, Sys::Syslog uses UDP to pass messages and everything behaves as expected. However, if it can't use UDP it uses socket and can't set the facility (sending everything as user.*). Other programs succesfully set the facility without using UDP (including "logger" and C programs). to reproduce the problem, edit /etc/default/syslogd, set LOG_FROM_REMOTE=NO and restart syslogd.
Subject: Re: [rt.cpan.org #19418] Sys::Syslog on Solaris-9 not logging to local0->local7
Date: Tue, 20 Jun 2006 23:02:49 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <maddingue [...] free.fr>
Hello, Show quoted text
> If syslogd's configured to listen on UDP, Sys::Syslog uses UDP to pass > messages and everything behaves as expected. However, if it can't use > UDP it uses socket and can't set the facility (sending everything as > user.*). > > Other programs succesfully set the facility without using UDP (including > "logger" and C programs). > > to reproduce the problem, edit /etc/default/syslogd, set > LOG_FROM_REMOTE=NO and restart syslogd.
Thanks for the details. I don't have a Solaris at hand to test on it, but I think I have a virtual machine with an OpenSolaris. I'll see if I can reproduce this problem. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
From: pirzyk [...] freebsd.org
On Tue Jun 20 17:03:43 2006, maddingue@free.fr wrote: Show quoted text
> Hello, >
> > If syslogd's configured to listen on UDP, Sys::Syslog uses UDP to pass > > messages and everything behaves as expected. However, if it can't use > > UDP it uses socket and can't set the facility (sending everything as > > user.*). > > > > Other programs succesfully set the facility without using UDP (including > > "logger" and C programs). > > > > to reproduce the problem, edit /etc/default/syslogd, set > > LOG_FROM_REMOTE=NO and restart syslogd.
To get the Sys::Syslog code not to use UDP, set the use Sys::Syslog qw(:DEFAULT setlogsock); setlogsock 'unix'; That *should* solve the problem, but I can verify that it does NOT work.
CC: Billy Nadeau <bill [...] cpan.org>, pirzyk [...] freebsd.org
Subject: Re: [rt.cpan.org #19418] Sys::Syslog on Solaris-9 not logging to local0->local7
Date: Fri, 07 Jul 2006 18:30:07 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <maddingue [...] free.fr>
Show quoted text
> To get the Sys::Syslog code not to use UDP, set the > > use Sys::Syslog qw(:DEFAULT setlogsock); > setlogsock 'unix'; > > That *should* solve the problem, but I can verify that it does NOT work.
For the Solaris users, can you try with the new "native" mechanism that was added in version 0.15? It will use the real syslog(3) functions like a C program would, and thus should avoid the problems associated with the UDP mechanism. » http://search.cpan.org/dist/Sys-Syslog/Syslog.pm#setlogsock (And I see that the documentation is incorrect: the "native" mechanism is the default beginning with version 0.16) -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
CC: bug-Sys-Syslog [...] rt.cpan.org, Billy Nadeau <bill [...] cpan.org>, pirzyk [...] freebsd.org
Subject: Re: [rt.cpan.org #19418] Sys::Syslog on Solaris-9 not logging to local0->local7
Date: Fri, 4 Jan 2008 16:28:41 +0100
To: Sébastien Aperghis-Tramoni <maddingue [...] free.fr>
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Sébastien Aperghis-Tramoni wrote: Show quoted text
>> To get the Sys::Syslog code not to use UDP, set the >> >> use Sys::Syslog qw(:DEFAULT setlogsock); >> setlogsock 'unix'; >> >> That *should* solve the problem, but I can verify that it does NOT >> work.
> > For the Solaris users, can you try with the new "native" mechanism > that was added in version 0.15? It will use the real syslog(3) > functions > like a C program would, and thus should avoid the problems associated > with the UDP mechanism. > » http://search.cpan.org/dist/Sys-Syslog/Syslog.pm#setlogsock > > (And I see that the documentation is incorrect: the "native" mechanism > is the default beginning with version 0.16)
I didn't heard anything back from you. Did you try to upgrade Sys::Syslog to a more recent version? Since 0.15, there's support for the native Unix mechanism which should avoid the problems you had. And I advise you to avoid using setlogsock() because Sys::Syslog now uses what should be the best mechanism for your system. Don't hesitate to ask if you have any question. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #19418] Sys::Syslog on Solaris-9 not logging to local0->local7
Date: Sun, 8 Jun 2008 03:32:44 +0200
To: bug-Sys-Syslog [...] rt.cpan.org, Billy Nadeau <bill [...] cpan.org>, pirzyk [...] freebsd.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Hello, As far as I can tell, this issue should be resolved with version 0.25. Don't hesitate to reopen the ticket if you encounter a problem. Thanks for your report. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.