[syslog-ng]Perl interface to syslog under Solaris

Balazs Scheidler syslog-ng@lists.balabit.hu
Fri, 05 Mar 2004 16:54:08 +0100


2004-03-05, p keltezéssel 13:36-kor Loic Minier ezt írta:
>      Hi,
> 
>  I am using the Perl interface to syslog (called Sys::Syslog) under
>  Solaris.  A lot of people are complaining that it doesn't work,
>  especially with the "stream" support, and I had to switch to udp().
> 
>  My problem is that I am using template("$MSG\n") for logging, which
>  seems to work for other udp sources, but produces a:
>  "myPerlProgram: log message" instead of a simple "log message" in the
>  logs.
> 
>  It is the same value as in my openlog() ident option, and if I use an
>  empty ident, I get:
>  "root: log message" instead.
> 
>  Can anyone give an example how not to insert such a prefix in my
>  messages?  I really would like to use the "stream" interface instead of
>  udp() because Perl makes many assumptions on where and how I'd like to
>  log.
> 
>  Here's my Perl init:
>  use Sys::Syslog qw(:DEFAULT setlogsock);
>  setlogsock('inet');
>  openlog('', '', 'local7');

Perl seems to avoid the syslog() calls from libc and does everything on
its own. While this is possible, it certainly has some portability
problems. The message is probably not properly formatted, at least
syslog-ng does not like it for some reason.

Check the raw byte-stream as it is sent by the Perl module, I might help
to recognize the culprit.

-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1