Adam Thomason > Perlbal-Plugin-Syslogger > Perlbal::Plugin::Syslogger

Download:
Perlbal-Plugin-Syslogger-1.00.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.00   Source  

NAME ^

Perlbal::Plugin::Syslogger - Perlbal plugin that adds low-impact syslog capabilities to client plugins

SYNOPSIS ^

    # plugin
    package Perlbal::Plugin::MyPlugin;

    use Perlbal::Plugin::Syslogger 'send_syslog_msg';

    sub register {
        my ($class, $svc) = @_;

        # explicit mode
        send_syslog_msg($svc, 'Registering MyPlugin');
        $svc->register_hook('MyPlugin', 'start_http_request' => sub {
            send_syslog_msg($svc, 'Handling request in MyPlugin');
        });

        # implicit mode
        Perlbal::Plugin::Syslogger::replace_perlbal_log($svc);
        Perlbal::log(info => "log message");
    }

    # perlbal config
    CREATE SERVICE fakeproxy
        SET role            = reverse_proxy
        SET listen          = 127.0.0.1:8080

        # set these after role/listen and before plugins
        SET syslog_host     = log-host
        SET syslog_port     = 514
        SET syslog_source   = perlbal-host
        SET syslog_name     = perlbal
        SET syslog_facility = 21
        SET syslog_severity = 5

        SET plugins         = Syslogger, MyPlugin
    ENABLE fakeproxy

FUNCTIONS ^

There are two (non-exclusive) ways of using the plugin. The explicit mode requires you to call send_syslog_msg for every log message. The implicit mode replaces Perlbal's standard Perlbal::log function.

CONFIGURATION ^

The following options are configurable with the SET command within the perlbal configuration file:

TRANSPORTS ^

Although logging calls made with this module are non-blocking with both UDP or TCP transports, the choice impacts its efficiency and reliability characteristics.

AUTHOR ^

Adam Thomason, <athomason@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2007-2010 by Six Apart, <cpan@sixapart.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: