line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SRS::EPP::Logging::SyslogAppender; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$SRS::EPP::Logging::SyslogAppender::VERSION = '0.22'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# A syslog appender class for log4perl that doesn't suck. |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
3372
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
88
|
|
9
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
85
|
|
10
|
1
|
|
|
1
|
|
1104
|
use Log::Dispatch::Syslog; |
|
1
|
|
|
|
|
39234
|
|
|
1
|
|
|
|
|
126
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
0
|
|
|
0
|
0
|
|
my ($class, $appender_name, $data) = @_; |
14
|
0
|
|
|
|
|
|
my $stderr; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my @param_names = qw/ident logopt facility socket min_level max_level/; |
17
|
0
|
|
|
|
|
|
my %params; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
foreach my $param (@param_names) { |
20
|
0
|
|
0
|
|
|
|
my $val = $data->{$param}{value} || $data->{ucfirst $param}{value}; |
21
|
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
|
$params{$param} = $val if defined $val; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
return Log::Log4perl::Appender->new("Log::Dispatch::Syslog", |
26
|
|
|
|
|
|
|
name => $appender_name, |
27
|
|
|
|
|
|
|
ident => '', |
28
|
|
|
|
|
|
|
%params, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |