1Log::Dispatch::Email::MUasielrSeCnodnmtariilb(u3t)ed PerLlogD:o:cDuimsepnattacthi:o:nEmail::MailSendmail(3)
2
3
4
6 Log::Dispatch::Email::MailSendmail - Subclass of Log::Dispatch::Email
7 that uses the Mail::Sendmail module
8
10 use Log::Dispatch::Email::MailSendmail;
11
12 my $email =
13 Log::Dispatch::Email::MailSendmail->new
14 ( name => 'email',
15 min_level => 'emerg',
16 to => [ qw( foo@bar.com bar@baz.org ) ],
17 subject => 'Oh no!!!!!!!!!!!', );
18
19 $email->log( message => 'Something bad is happening', level => 'emerg' );
20
22 This is a subclass of Log::Dispatch::Email that implements the
23 send_email method using the Mail::Sendmail module.
24
26 * new
27 This method takes a hash of parameters. The following options are
28 valid:
29
30 * name ($)
31 The name of the object (not the filename!). Required.
32
33 * min_level ($)
34 The minimum logging level this object will accept. See the
35 Log::Dispatch documentation on Log Levels for more informa‐
36 tion. Required.
37
38 * max_level ($)
39 The maximum logging level this obejct will accept. See the
40 Log::Dispatch documentation on Log Levels for more informa‐
41 tion. This is not required. By default the maximum is the
42 highest possible level (which means functionally that the
43 object has no maximum).
44
45 * subject ($)
46 The subject of the email messages which are sent. Defaults
47 to "$0: log email"
48
49 * to ($ or \@)
50 Either a string or a list reference of strings containing
51 email addresses. Required.
52
53 * from ($)
54 A string containing an email address. This is optional and
55 may not work with all mail sending methods.
56
57 NOTE: The Mail::Sendmail module requires an address be
58 passed to it to set this in the mail it sends. We pass in
59 'LogDispatch@foo.bar' as the default.
60
61 * buffered (0 or 1)
62 This determines whether the object sends one email per mes‐
63 sage it is given or whether it stores them up and sends
64 them all at once. The default is to buffer messages.
65
66 * callbacks( \& or [ \&, \&, ... ] )
67 This parameter may be a single subroutine reference or an
68 array reference of subroutine references. These callbacks
69 will be called in the order they are given and passed a
70 hash containing the following keys:
71
72 ( message => $log_message, level => $log_level )
73
74 The callbacks are expected to modify the message and then
75 return a single scalar containing that modified message.
76 These callbacks will be called when either the "log" or
77 "log_to" methods are called and will only be applied to a
78 given message once.
79
80 * log_message( level => $, message => $ )
81 Sends a message if the level is greater than or equal to the
82 object's minimum level.
83
85 Dave Rolsky, <autarch@urth.org>
86
87
88
89perl v5.8.8 2006-12-L2o0g::Dispatch::Email::MailSendmail(3)