Log::Syslog::Abstract - Use any available syslog API


Log-Syslog-Abstract documentation  | view source Contained in the Log-Syslog-Abstract distribution.

Index


NAME

Top

Log::Syslog::Abstract - Use any available syslog API

VERSION

Top

Version 1.000

SYNOPSIS

Top

    use Log::Syslog::Abstract qw(openlog syslog closelog);

    openlog( 'myapp', 'pid,ndelay', 'local0' );
    ...
    syslog('info', '%s: %s', 'Something bad happened', $!);
    ...
    closelog();

DESCRIPTION

Top

This module provides the bare minimum common API to Unix::Syslog and Sys::Syslog, using whichever one happens to be available.

FUNCTIONS

Top

openlog ( $ident, $options, $facility )

Opens a connection to the system logger.

$ident is an identifier string that syslog will include in every message. It is normally set to the process name.

$options is a comma-separated list of options. Valid options are:

ndelay

Don't delay open until first syslog() call

pid

Log the process ID with each message

$facility is a string indicating the syslog facility to be used. Valid values are:

auth
authpriv
cron
daemon
ftp
kern
lpr
mail
mark
news
security
syslog
user
uucp
local0
local1
local2
local3
local4
local5
local6
local7

syslog ( $priority, $format, @args )

Generates a log message and passes it to the appropriate syslog backend.

$priority should be a string containing one of the valid priority names:

alert
crit
debug
emerg
err
error
info
none
notice
panic
warn
warning

$format is a format string in the style of printf(3)

@args is a list of values that will replace the placeholders in $format

closelog ( )

Closes the connection to syslog.

EXPORT

Top

Nothing is exported by default. Specify what you need on the use() line, or call with package-qualified name.

DEPENDENCIES

Top

At least one of Unix::Syslog or Sys::Syslog must be present, or Log::Syslog::Abstract will die at use() time.

AUTHOR

Top

Dave O'Neill, <dmo at roaringpenguin.com>

BUGS

Top

Please report any bugs or feature requests to bug-log-syslog-abstract at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Log-Syslog-Abstract. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Log::Syslog::Abstract

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Log-Syslog-Abstract

* CPAN Ratings

http://cpanratings.perl.org/d/Log-Syslog-Abstract

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Log-Syslog-Abstract

* Search CPAN

http://search.cpan.org/dist/Log-Syslog-Abstract

COPYRIGHT & LICENSE

Top


Log-Syslog-Abstract documentation  | view source Contained in the Log-Syslog-Abstract distribution.