Red Hat Bugzilla – Bug 67607
Last modified: 2007-04-18 12:43:43 EDT
Description of Problem:
The Sys::Syslog modules does not produce any output to syslog
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Run attached script
2. Look in /var/log/messages
Log message in /var/log/messages
This is a major issue for software using Sys::Syslog as it will cause failure
and diagnostic messages to be silently lost.
Created attachment 63004 [details]
From "perldoc Sys::Syslog":
setlogsock $sock_type (added in 5.004_02)
Sets the socket type to be used for the next call to
"openlog()" or "syslog()" and returns TRUE on success,
undef on failure.
A value of 'unix' will connect to the UNIX domain
socket returned by the "_PATH_LOG" macro (if you sys-
tem defines it) in syslog.h. A value of 'inet' will
connect to an INET socket returned by getservbyname().
If "_PATH_LOG" is unavailable or if getservbyname()
fails, returns undef. Any other value croaks.
The default is for the INET socket to be used.
So, you need a setlogsock('unix'); in your program, and it will work.
Alternatively, you can enable network logging via starting syslogd with the -r
switch, which can be added to /etc/sysconfig/syslog's SYSLOGD_OPTIONS setting,
followed by restarting the syslog service.