Syslog problem on Solaris 2.9

Discussion in 'Perl Misc' started by A, Apr 20, 2007.

  1. A

    A Guest

    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.
    A, Apr 20, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    6,026
    Chris Uppal
    Jun 20, 2006
  2. Thomas Glanzmann

    Sys::Syslog issue on Solaris 9 with perl-5.8.2

    Thomas Glanzmann, Jan 10, 2004, in forum: Perl Misc
    Replies:
    4
    Views:
    164
    Thomas Glanzmann
    Jan 10, 2004
  3. Loic Minier

    Sys::Syslog under Solaris

    Loic Minier, Mar 5, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    142
    Loic Minier
    Mar 6, 2004
  4. leroy isaac
    Replies:
    1
    Views:
    465
    James Willmore
    Oct 29, 2004
  5. Bad Dog
    Replies:
    0
    Views:
    225
    Bad Dog
    Aug 9, 2007
Loading...

Share This Page