Reputation:
Has anyone got Sys::Syslog to work on Solaris? (I'm running Sys::Syslog 0.05 on Perl v5.8.4 on SunOS 5.10 on SPARC). Here's what doesn't work for me:
openlog "myprog", "pid", "user" or die;
syslog "crit", "%s", "Test from $0" or die;
closelog() or warn "Can't close: $!";
system "tail /var/adm/messages";
Whatever I do, the closelog returns an error and nothing ever gets logged anywhere.
Upvotes: 0
Views: 1336
Reputation: 1327
By default, Sys::Syslog is going to try to connect with one of the following socket types:
[ 'tcp', 'udp', 'unix', 'stream' ]
On Solaris, though, you'll need to use an inet socket. Call:
setlogsock('inet', $hostname);
and things should start working.
Upvotes: 3
Reputation: 12852
In general you can answer "does module $x work on platform $y" questions by looking at the CPAN testers matrix, like here.
Upvotes: 1
Reputation:
setlogsock('inet') didn't do it for me (it looks for host "syslog") but building and installing Sys::Syslog from CPAN did. The Sys::Syslog that comes with Solaris 10 is ancient.
Upvotes: 0