The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Logger::Syslog -- an simple wrapper over Syslog for Perl

DESCRIPTION

You want to deal with syslog, but you don't want to bother with Sys::Syslog, that module is for you.

Logger::Syslog takes care of everything regarding the Syslog communication, all you have to do is to use the function you need to send a message to syslog.

Logger::Syslog provides one function per Syslog message level: debug, info, warning, error, notice, critic, alert.

NOTES

Logger::Syslog is compliant with mod_perl, all you have to do when using it in such an environement is to call logger_init() at the beginning of your CGI, that will garantee that everything will run smoothly (otherwise, issues with the syslog socket can happen in mod_perl env).

SYNOPSIS

    use Logger::Syslog;

    info("Starting at".localtime());
    
    #...

    if (error) {
        error("An error occured!");
        exit 1;
    }

    notice("There something to notify");
    ...
     

FUNCTIONS

logger_init

That function has to be called in mod_perl environment. It will open the Syslog socket properly.

logger_close

Call this to close the Syslog socket.

logger_prefix

That function lets you set a string that will be prefixed to every messages sent to syslog.

Example:

    logger_prefix("my program");
    info("starting");
    ...
    info("stopping");

logger_set_default_facility(facility)

You can choose which facility to use, the default one is "user".

Example:

    logger_set_default_facility("cron");

debug(message)

Send a message to syslog, of the level "debug".

info(message)

Send a message to syslog, of the level "info".

notice(message)

Send a message to syslog, of the level "notice".

notice(message)

Envoie un message de type notice a syslog

warning(message)

Send a message to syslog, of the level "warning".

error(message)

Send a message to syslog, of the level "error".

critic(message)

Send a message to syslog, of the level "critic".

alert(message)

Send a message to syslog, of the level "alert".

LICENSE

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

COPYRIGHT

This program is copyright © 2004-2006 Alexis Sukrieh

AUTHOR

Alexis Sukrieh <sukria@sukria.net>

Very first versions were made at Cegetel (2004-2005) ; Thomas Parmelan gave a hand for the mod_perl support.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 335:

Non-ASCII character seen before =encoding in '©'. Assuming CP1252