Syslog(3pm) User Contributed Perl Documentation Syslog(3pm)
NAME
Sys::Syslog - Perl interface to the UNIX syslog(3) calls
VERSION
This is the documentation of version 0.29
SYNOPSIS
use Sys::Syslog; # all except setlogsock()
use Sys::Syslog qw(:standard :macros); # standard functions & macros
openlog($ident, $logopt, $facility); # don't forget this
syslog($priority, $format, @args);
$oldmask = setlogmask($mask_priority);
closelog();
DESCRIPTION
"Sys::Syslog" is an interface to the UNIX syslog(3) program. Call "syslog()" with a string priority and a list of "printf()" args just
like syslog(3).
You can find a kind of FAQ in "THE RULES OF SYS::SYSLOG". Please read it before coding, and again before asking questions.
EXPORTS
"Sys::Syslog" exports the following "Exporter" tags:
o ":standard" exports the standard syslog(3) functions:
openlog closelog setlogmask syslog
o ":extended" exports the Perl specific functions for syslog(3):
setlogsock
o ":macros" exports the symbols corresponding to most of your syslog(3) macros and the "LOG_UPTO()" and "LOG_MASK()" functions. See
"CONSTANTS" for the supported constants and their meaning.
By default, "Sys::Syslog" exports the symbols from the ":standard" tag.
FUNCTIONS
openlog($ident, $logopt, $facility)
Opens the syslog. $ident is prepended to every message. $logopt contains zero or more of the options detailed below. $facility
specifies the part of the system to report about, for example "LOG_USER" or "LOG_LOCAL0": see "Facilities" for a list of well-known
facilities, and your syslog(3) documentation for the facilities available in your system. Check "SEE ALSO" for useful links. Facility
can be given as a string or a numeric macro.
This function will croak if it can't connect to the syslog daemon.
Note that "openlog()" now takes three arguments, just like openlog(3).
You should use "openlog()" before calling "syslog()".
Options
o "cons" - This option is ignored, since the failover mechanism will drop down to the console automatically if all other media fail.
o "ndelay" - Open the connection immediately (normally, the connection is opened when the first message is logged).
o "noeol" - When set to true, no end of line character ("
") will be appended to the message. This can be useful for some buggy
syslog daemons.
o "nofatal" - When set to true, "openlog()" and "syslog()" will only emit warnings instead of dying if the connection to the syslog
can't be established.
o "nonul" - When set to true, no "NUL" character ("