Alan Kasindorf > Perlbal-1.80 > Perlbal::Manual::Logging

Download:
Perlbal-1.80.tar.gz

Annotate this POD

CPAN RT

New  4
Open  3
View/Report Bugs
Source  

NAME ^

Perlbal::Manual::Logging - How Perlbal's logging system works

VERSION

Perlbal 1.78.

DESCRIPTION

Perlbal supports logging of a few messages (and you can log your messages in your plugins, for instance).

This document describes how to achieve that.

IMPORTANT: foreground vs. background

If Perlbal is running on the foreground, it logs by calling printf, which means you should get the logs on STDOUT.

If Perlbal is running on the background, it logs through Sys::Syslog. If Sys::Syslog is not available, there will be no logging, and THAT'S THE MOST IMPORTANT THING TO KNOW ABOUT PERLBAL'S LOGGING SYSTEM.

How to log a message

You can log a message by calling Perlbal::log as you'd call Sys::Syslog's syslog:

    Perlbal::log( $priority, $format, @args );

You should read the documentation for Sys::Syslog for more information, but here's an example:

    Perlbal::log( 'info', 'beginning run' );

And here's another example:

    Perlbal::log( 'crit', "this thing crashed: $!" );

What is logged?

Generating more logs by sending a USR1 signal to perlbal

If you send a USR1 signal to perlbal, that tells it to log some basic statistics to the syslog.

It's similar to connecting to a management service and issue a show service for each service, plus a states and a queues commands.

Where is it logged to?

The way Perlbal opens Sys::Syslog, it logs to /var/log/daemon.log by default.

SEE ALSO

You can tweek Sys::Syslog's configuration under /etc/syslog.conf. See Sys::Syslog for more details.

syntax highlighting: