1 | <?php |
||
7 | class LumberjackHandler extends AbstractProcessingHandler |
||
8 | { |
||
9 | const DEFAULT_WINDOW_SIZE = 5000; |
||
10 | |||
11 | /** @var Lumberjack\Client */ |
||
12 | private $client; |
||
13 | |||
14 | private $enabled = true; |
||
15 | |||
16 | /** |
||
17 | * @param string $host IP or hostname |
||
18 | * @param int $port Port where Logstash listen connections with input lumberjack |
||
19 | * @param string $cafile path to certificate file |
||
20 | * @param array $options various lumberjack options (@see Lumberjack\Client) |
||
21 | * @return LumberjackHandler |
||
22 | */ |
||
23 | public function init($host, $port, $cafile, array $options = array()) |
||
49 | |||
50 | /** |
||
51 | * @return Lumberjack\Client |
||
52 | */ |
||
53 | public function getClient() |
||
57 | |||
58 | /** |
||
59 | * @param Lumberjack\Client $client |
||
60 | * @return LumberjackHandler |
||
61 | */ |
||
62 | public function setClient(Lumberjack\Client $client) |
||
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | public function isHandling(array $record) |
||
75 | |||
76 | /** |
||
77 | * {@inheritdoc} |
||
78 | * @throws \RuntimeException |
||
79 | */ |
||
80 | protected function write(array $record) |
||
95 | } |
||
96 |