David O'Neill
and 1 contributors

NAME

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

VERSION

Version 1.000

SYNOPSIS

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

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

DESCRIPTION

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

FUNCTIONS

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

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

DEPENDENCIES

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

AUTHOR

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

BUGS

  • Currently, no validation is performed on the strings provided for options, facility names, or message priority. Bogus data may give bizzare results.

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

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

    perldoc Log::Syslog::Abstract

You can also look for information at:

COPYRIGHT & LICENSE

Copyright 2007 Dave O'Neill, all rights reserved

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