JYDawg has asked for the wisdom of the Perl Monks concerning the following question:

I'm working on a way to create a more generic way of logging using syslog-ng's unix-stream tag, but I'm missing a (good) way of accessing the socket through the regular perl Sys::Syslog or Unix::Syslog interface.

Basicly the socket has changed from the default /dev/log to /appl/dunno/var/log/socket. When I use logger -u /appl/dunno/var/log/socket "some message" it works. All I need now is a good way of doing this through perl.

Any idea's or sugestions?

--- Lead me not into temptation for I can find it myself...

Replies are listed 'Best First'.
Re: Sys::Syslog and socket location
by gellyfish (Monsignor) on Jan 06, 2005 at 11:29 UTC

    I think you want to do something like:

    setlogsock 'unix', '/appl/dunno/var/log/socket';
    before calling syslog - if I guess correctly what you are trying to do.

    /J\

      Doesn't work the socket locations seem to be hardcoded in the module.
      --- Lead me not into temptation for I can find it myself...

        Ah yes, well the path itself isn't so much hard coded into the module Sys::Syslog as the assumption that you will only want to use the system defined _PATH_LOG - having examined the code it seems fairly trivial to fix, if I get bored I'll do a patch.

        /J\