Syslog problem on Solaris 2.9

A

A

I'm using Sys::Syslog but nothing is being written to the logs.

I'd appreciate your help on this.

This is on Solaris 2.9 on SPARC.

File /etc/syslog.conf contains
local1.info /var/log/mylog

Here's the test script.

#+++++++++++++++++++++
#!/usr/local/bin/perl

use Sys::Syslog;
use diagnostics;
use strict;

my $r;

$r = &Sys::Syslog::eek:penlog("$0 $$", "ndelay,pid", "local1");
print STDERR "$$: openlog returned $r\n";

$r = &Sys::Syslog::syslog("info", "Test of info to local1");
print STDERR "$$: syslog returned $r\n";

$r = &Sys::Syslog::closelog();
print STDERR "$$: closelog returned $r\n";

print STDERR "$$: $0: End\n";
#---------------------------------

When I run it, I get:

$ testsyslog
6491: openlog returned Sys::Syslog::SYSLOG
6491: syslog returned 1
6491: closelog returned 1
6491: testsyslog: End

but nothing is printed to /var/log/mylog, while if I run

$ logger -p "local1.info" -t "from_logger $$" "Test1_logger"

then the following line is added to /var/log/mylog:

Apr 20 16:59:09 myhost from_logger 14256: [ID 702911 local1.info]
Test1_logger

I also tried adding (on Perl 5.8.8)

$r = &Sys::Syslog::setlogsock('stream', '/dev/conslog');
print STDERR "$$: setlogsock returned $r\n";

above the openlog() but that doesn't change the symptom.

The machine has two versions of Perl installed, Perl 5.6.1 which came
with Solaris and Perl 5.8.8 with threads. The behaviour is same with
both versions of Perl.

What am I doing wrong?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top