[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Omaha.pm] [patch] Sys::Syslog POD - $Sys::Syslog::host
You can change $Sys::Syslog::host and the package will happily go connect (TCP or UDP) to a remote server. Works great. However, here is no interface to change $Sys::Syslog::host, and the feature isn't documented.
Instead of changing openlog(), connect(), connect_udp(), connect_tcp(), and documenting all of that; I thought it would just be easier to document changing $Sys::Syslog::host.
Objections?
j
--- Syslog.pm 2004-03-06 15:30:08.000000000 -0600
+++ new_Syslog.pm 2004-09-15 14:11:19.000000000 -0500
@@ -128,6 +128,12 @@
$! = 55;
syslog('info', 'problem was %m'); # %m == $! in syslog(3)
+ # Log to UDP port on $remotehost instead of logging locally
+ setlogsock('udp');
+ $Sys::Syslog::host = $remotehost;
+ openlog($program, 'ndelay', 'user');
+ syslog('info', 'something happened over here');
+
=head1 SEE ALSO
L<syslog(3)>