develooper Front page | perl.perl5.porters | Postings from July 2001

development & enhancement of Sys::Syslog

Thread Next
Nick Williams
July 23, 2001 09:18
development & enhancement of Sys::Syslog
Message ID:

I am interesting in testing the appetite for modifying the Sys::Syslog
module in order to allow different connection backends. I've looked
around, but have so far found no interesting developments in this area
to date.

The problem: currently, Sys::Syslog defaults to a udp connection, but
also allows for a unix domain socket. However, there are a variety of
platforms in existence for which neither of those are default, or even
possible in some configurations. For example, syslog-ng (and secure
syslog) provide a TCP interfaces, as do the IETF proposals for 'reliable
syslog'. Also, the solaris syslog daemon, by default, listens on a
stream interface which from observation does not work well when treated
as a unix domain socket (although that could just be me :).

So, I'd like to get the Syslog module to work with these other
scenarios. Note that I don't like the idea of having to use
setlogsock(), since that involves changing existing code (possibly
vendor code) - I'd rather the handle that abstraction for me. 

To try out my thoughts, I've modified a local copy of Sys::Syslog to
have a variety of different connection backends for it to use as a
communication method to the daemon. It works well in that I can take a
perl program which uses Sys::Syslog and it correctly logs whether it's
on a machine with 'standard' UDP syslog, or on a machine running
Syslog-NG which is only listening for TCP connections. 

The code that I have is available on request, but the basic idea is that
it has backend 'drivers' for different connection methods and it takes a
list of drivers to attempt. The best method which succeeds at connection
is used. When a failure is detected, it re-evaluates this connection
loop to get to an alternative backend.

What I'd like to see is if there is interest in this kind of enhancement
making it into the core module, or if not, then ideas on different ways
of getting to a solution.


p.s. I know that the other alternative is to XS the libc version of
syslog, which is an attractive idea since it would mean that all
applications on the box perl or C would be using a consistent method for
logging... however XS has its woes - this perl module is a trivial
implementation and it actually provides better functionality and
failover handling than libc would.
Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About