1 | <?php |
||
28 | class ElasticsearchHandler extends AbstractProcessingHandler |
||
29 | { |
||
30 | const DEFAULT_INDEX_NAME = 'monolog'; |
||
31 | const DEFAULT_TYPE_NAME = 'record'; |
||
32 | |||
33 | /** |
||
34 | * @var Client |
||
35 | */ |
||
36 | protected $client; |
||
37 | |||
38 | /** |
||
39 | * @var array Handler config options |
||
40 | */ |
||
41 | protected $options = []; |
||
42 | |||
43 | /** |
||
44 | * @param Client $client Elastica Client object |
||
45 | * @param array $options Handler configuration |
||
46 | * @param integer $level The minimum logging level at which this handler will be triggered |
||
47 | * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not |
||
48 | */ |
||
49 | public function __construct(Client $client, array $options = [], $level = Logger::DEBUG, $bubble = true) |
||
56 | |||
57 | /** |
||
58 | * {@inheritDoc} |
||
59 | */ |
||
60 | protected function write(array $record) |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | public function setFormatter(FormatterInterface $formatter) |
||
76 | |||
77 | /** |
||
78 | * Getter options |
||
79 | * @return array |
||
80 | */ |
||
81 | public function getOptions() |
||
85 | |||
86 | /** |
||
87 | * {@inheritDoc} |
||
88 | */ |
||
89 | protected function getDefaultFormatter() |
||
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | public function handleBatch(array $records) |
||
103 | } |
||
104 |