NAME

NetSDS::Logger - syslog wrapper for applications and classes

SYNOPSIS

use NetSDS::Logger;

my $logger = NetSDS::Logger->new();
$logger->log("info", "Syslog message here");

DESCRIPTION

This module contains implementation of logging functionality for NetSDS components.

By default, messages are logged with local0 facility and pid,ndelay,nowait options.

NOTE: NetSDS::Logger module is for internal use mostly from application frameworks like NetSDS::App, NetSDS::App::FCGI, etc.

CONSTRUCTOR

new(%parameters)

Constructor new() creates new logger object and opens socket with default NetSDS logging parameters.

Arguments allowed (as hash):

name - application name

This parameter may be used for identifying application in syslog messages

facility - logging facility

If not set 'local0' is used as default value

my $object = NetSDS->new(%options);

OBJECT/CLASS METHODS

log($level, $message) - write record to log

Wrapper to syslog() method of Unix::Syslog module.

Level is passed as string and may be one of the following:

alert	- LOG_ALERT
crit	- LOG_CRIT
debug	- LOG_DEBUG
emerg	- LOG_EMERG
error	- LOG_ERR
info	- LOG_INFO
notice	- LOG_NOTICE
warning	- LOG_WARNING

DESTRUCTOR

Destructor (DESTROY method) calls closelog() function. That's all.

EXAMPLES

See NetSDS::App for example.

BUGS

Unknown yet

SEE ALSO

Sys::Syslog

TODO

1. Implement logging via UDP socket.

AUTHOR

Michael Bochkaryov <misha@rattler.kiev.ua>