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

Fault::Delegate::Syslog - Syslog delegate

SYNOPSIS

 use Fault::Delegate::Syslog;
 $self = Fault::Delegate::Syslog->new;
 $okay = $self->log ($msg);

Inheritance

 UNIVERSAL
   Fault::Delegate
     Fault::Delegate::Syslog

Description

This is a delegate that writes log messages to the syslog. Syslogging must be accessible to the calling program.

Fault::Delegate::Syslog satisfies the minimum requirements of the Fault::Delegate logger delegate protocol.

Examples

 use Fault::Delegate::Syslog;
 use Fault::Msg;
 use Fault::Logger;

 my $msg       = Fault::Msg                   ("Arf!");
 my $baz       = Fault::Delegate::Syslog->new;
 my $waslogged = $baz->log                    ($msg);

                 Fault::Logger->new           ($baz);
 my $waslogged = Fault::Logger->log           ("Bow! Wow!");

 [See Fault::Logger for a detailed example.]

Instance Variables

 init     True if a syslog connection was succesfully initialized.

Class Methods

$delegate = Fault::Delegate::Syslog->new

Create a logger delegate object that writes log messages to syslog. A warning is issued if the program cannot initialize and write a startup message to syslog.

Returns undef if it fails to set up the syslog connection.

Logger Protocol Instance Methods

$didlog = $self->log ($msgobj)

Send the information contained in $msgobj to syslog at the $priority contained by it and return true if we succeeded in doing so. The message is formatted so that it will appear in the log like this:

 Apr 17 18:00:36 localhost UnspecifiedProcess[12638]: NOTE(notice): Testing syslogger again

Private Class Methods

None.

Private Instance Methods

$bool = $self->_write ($msg)
$bool = $self->_connect

Impliments the above overrides to the internal family protocol utilized by the Fault:Delegate log and test methods.

Errors and Warnings

Local warning messages are issued if the sys logger cannot be reached or has any problems whatever.

SEE ALSO

Fault::Logger, Fault::Delegate, Fault::Msg, Sys::Syslog Fault::ErrorHandler

AUTHOR

Dale Amon <amon@vnl.com>

3 POD Errors

The following errors were encountered while parsing the POD:

Around line 113:

=back doesn't take any parameters, but you said =back 4

Around line 127:

=back doesn't take any parameters, but you said =back 4

Around line 144:

=back doesn't take any parameters, but you said =back 4