1Log::Dispatch::Syslog(3U)ser Contributed Perl DocumentatiLoong::Dispatch::Syslog(3)
2
3
4

NAME

6       Log::Dispatch::Syslog - Object for logging to system log.
7

SYNOPSIS

9         use Log::Dispatch::Syslog;
10
11         my $file = Log::Dispatch::Syslog->new( name      => 'file1',
12                                                min_level => 'info',
13                                                ident     => 'Yadda yadda' );
14
15         $file->log( level => 'emerg', message => "Time to die." );
16

DESCRIPTION

18       This module provides a simple object for sending messages to the system
19       log (via UNIX syslog calls).
20

METHODS

22       * new(%p)
23           This method takes a hash of parameters.  The following options are
24           valid:
25
26           * name ($)
27                   The name of the object.  Required.
28
29           * min_level ($)
30                   The minimum logging level this object will accept.  See the
31                   Log::Dispatch documentation on Log Levels for more informa‐
32                   tion.  Required.
33
34           * max_level ($)
35                   The maximum logging level this obejct will accept.  See the
36                   Log::Dispatch documentation on Log Levels for more informa‐
37                   tion.  This is not required.  By default the maximum is the
38                   highest possible level (which means functionally that the
39                   object has no maximum).
40
41           * ident ($)
42                   This string will be prepended to all messages in the system
43                   log.  Defaults to $0.
44
45           * logopt ($)
46                   A string containing the log options (separated by any sepa‐
47                   rator you like).  Valid options are 'cons', 'pid', 'nde‐
48                   lay', and 'nowait'.  See the openlog(3) and Sys::Syslog
49                   docs for more details.  I would suggest not using 'cons'
50                   but instead using Log::Dispatch::Screen.  Defaults to ''.
51
52           * facility ($)
53                   Specifies what type of program is doing the logging to the
54                   system log.  Valid options are 'auth', 'authpriv', 'cron',
55                   'daemon', 'kern', 'local0' through 'local7', 'mail, 'news',
56                   'syslog', 'user', 'uucp'.  Defaults to 'user'
57
58           * socket ($)
59                   Tells what type of socket to use for sending syslog mes‐
60                   sages.  Valid options are 'unix' or 'inet'.  Defaults to
61                   'unix'.
62
63           * callbacks( \& or [ \&, \&, ... ] )
64                   This parameter may be a single subroutine reference or an
65                   array reference of subroutine references.  These callbacks
66                   will be called in the order they are given and passed a
67                   hash containing the following keys:
68
69                    ( message => $log_message, level => $log_level )
70
71                   The callbacks are expected to modify the message and then
72                   return a single scalar containing that modified message.
73                   These callbacks will be called when either the "log" or
74                   "log_to" methods are called and will only be applied to a
75                   given message once.
76
77       * log_message( message => $ )
78           Sends a message to the appropriate output.  Generally this
79           shouldn't be called directly but should be called through the
80           "log()" method (in Log::Dispatch::Output).
81

AUTHOR

83       Dave Rolsky, <autarch@urth.org>
84
85
86
87perl v5.8.8                       2006-12-20          Log::Dispatch::Syslog(3)
Impressum