line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Log::Saftpresse::Input::Lumberjack; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1672
|
use Moose; |
|
1
|
|
|
|
|
110
|
|
|
1
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
5830
|
use Log::Saftpresse::Log4perl; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
150
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: lumberjack server input plugin for saftpresse |
8
|
|
|
|
|
|
|
our $VERSION = '1.6'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
extends 'Log::Saftpresse::Input::Server'; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
639
|
use Net::Lumberjack::Reader; |
|
1
|
|
|
|
|
274291
|
|
|
1
|
|
|
|
|
383
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has 'readers' => ( |
15
|
|
|
|
|
|
|
is => 'ro', isa => 'HashRef[Net::Lumberjack::Reader]', |
16
|
|
|
|
|
|
|
default => sub { {} }, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub handle_cleanup_connection { |
20
|
0
|
|
|
0
|
0
|
|
my ( $self, $conn ) = @_; |
21
|
0
|
|
|
|
|
|
delete $self->readers->{"$conn"}; |
22
|
0
|
|
|
|
|
|
return; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _get_reader { |
26
|
0
|
|
|
0
|
|
|
my ( $self, $conn ) = @_; |
27
|
0
|
0
|
|
|
|
|
if( ! defined $self->readers->{"$conn"} ) { |
28
|
0
|
|
|
|
|
|
$self->readers->{"$conn"} = Net::Lumberjack::Reader->new( |
29
|
|
|
|
|
|
|
handle => $conn, |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
|
return $self->readers->{"$conn"}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub handle_data { |
36
|
0
|
|
|
0
|
0
|
|
my ( $self, $conn ) = @_; |
37
|
0
|
|
|
|
|
|
my @events; |
38
|
0
|
|
|
|
|
|
my $reader = $self->_get_reader( $conn ); |
39
|
0
|
|
|
|
|
|
while( my @data = $reader->read_data ) { |
40
|
0
|
|
|
|
|
|
push( @events, @data ); |
41
|
|
|
|
|
|
|
} |
42
|
0
|
|
|
|
|
|
$reader->send_ack; |
43
|
0
|
|
|
|
|
|
return @events; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
__END__ |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=pod |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=encoding UTF-8 |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 NAME |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Log::Saftpresse::Input::Lumberjack - lumberjack server input plugin for saftpresse |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 VERSION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
version 1.6 |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 AUTHOR |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Markus Benning <ich@markusbenning.de> |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
This software is Copyright (c) 1998 by James S. Seymour, 2015 by Markus Benning. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This is free software, licensed under: |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
The GNU General Public License, Version 2, June 1991 |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |