Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: Gerard.Henry [...] cmi.univ-mrs.fr
Cc:
AdminCc:

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



Subject: Sys::Syslog doesn't work on opensolaris
Date: Fri, 27 Nov 2009 19:04:18 +0100
To: bug-Sys-Syslog [...] rt.cpan.org
From: Gérard Henry <Gerard.Henry [...] cmi.univ-mrs.fr>
hello, i've a big trouble with this module, because the application i use never writes to syslog system. First, i read the bug: http://rt.cpan.org/Public/Bug/Display.html?id=40305 So my system displays: # perl -MSys::Syslog -wle'print $Sys::Syslog::VERSION' 0.27 as you can see, it is the latest release. The, i use the C file you gave in the bug 40305, and it works: cat test_syslog.c #include <syslog.h> int main(void) { openlog("tester", LOG_NDELAY, LOG_USER); syslog(LOG_LOCAL6|LOG_INFO, "another syslog test (from C)"); closelog(); return 0; } ./test_syslog and in /var/log/syslog: Nov 27 18:54:32 catalogue4 tester: [ID 231973 local6.info] another syslog test (from C) Now, i did some tests with perl code: perl -MSys::Syslog -e 'Sys::Syslog::syslog("local6|info", "this is a better test: %d", time);' perl -MSys::Syslog -e 'Sys::Syslog::syslog(LOG_INFO, "this is a better test: %d", time);' but: perl -MSys::Syslog -e 'Sys::Syslog::syslog(LOG_INFO|LOG_LOCAL6, "this is a better test: %d", time);' syslog: invalid level/facility: LOG_MOGOL6 at -e line 1 I'm actually using perl 5.8.8 Could you help me? thanks in advance, gerard -- Gerard HENRY LATP UMR6632 39, rue F. Joliot Curie 13453 MARSEILLE Cedex 13 Tel.: 04 91 11 35 85 Fax.: 04 91 11 35 52
Subject: Re: [rt.cpan.org #52131] Sys::Syslog doesn't work on opensolaris
Date: Mon, 18 Apr 2011 14:51:15 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Hello, Apologies for the long delay before answering you. Gérard Henry wrote via RT: Show quoted text
> i've a big trouble with this module, because the application i use > never > writes to syslog system. > First, i read the bug: > http://rt.cpan.org/Public/Bug/Display.html?id=40305 > > So my system displays: > # perl -MSys::Syslog -wle'print $Sys::Syslog::VERSION' > 0.27 > > as you can see, it is the latest release. > > [...] > > Now, i did some tests with perl code: > perl -MSys::Syslog -e 'Sys::Syslog::syslog("local6|info", "this is a > better test: %d", time);' > perl -MSys::Syslog -e 'Sys::Syslog::syslog(LOG_INFO, "this is a better > test: %d", time);' > > but: > perl -MSys::Syslog -e 'Sys::Syslog::syslog(LOG_INFO|LOG_LOCAL6, > "this is > a better test: %d", time);' > syslog: invalid level/facility: LOG_MOGOL6 at -e line 1 > > I'm actually using perl 5.8.8 > > Could you help me?
This is simply because you didn't asked Sys::Syslog to import the facilities macros for you, therefore Perl sees this as barewords, and does a binary OR on the strings "LOG_INFO" and "LOG_LOCAL6", giving the result "LOG_MOGOL6", which of course makes no sense for Sys::Syslog. The usual way to invoke Sys::Syslog with macros is: use Sys::Syslog qw< :standard :macros >; or, as a oneliner: perl -MSys::Syslog=:standard,:macros -e '...' -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.