The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::SyslogNg - client module for writing to syslog server (rfc5424)

VERSION

version 0.03

SYNOPSYS

    use Net::SyslogNg;

    # Create Net::SyslogNg object
    my $syslog = Net::SyslogNg->new(
        '-syslog_host'      => '127.0.0.1',
        '-syslog_port'      => 514,
    );

    # Send message to syslog
    $syslog->send(
        '-facility'         => 'daemon',
        '-priority'         => 'error',
        '-msg'              => 'Syslog error message',
    );

METHODS

new(%opt)

Create Net::SyslogNg object

    Options:
        -syslog_host            => Syslog host address
        -syslog_port            => Syslog port number
        -facility               => Facility name
        -priority               => Priority name
        -debug                  => Enable printing debug messages (default: 0)

send(%opt)

Send message to syslog daemon

    Options:
        -facility               => Facility name
        -priority               => Priority name
        -pid                    => Process id number (default: current process id)
        -msg                    => String of message
        -version                => Version number (default: 1)
        -timestamp              => Timestamp of message (default: current time in UTC)
        -hostname               => Hostname of syslog client (default: current hostname)
        -message_id             => Message id
        -structured_data        => Structured data field
        -application            => Application name

DEPENDENCE

Sys::Hostname, IO::Socket::INET, DateTime

AUTHORS

  • Pavel Andryushin <vrag867@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2020 by Pavel Andryushin.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.