1 | <?php declare(strict_types = 1); |
||
10 | class LogDNAHandler extends AbstractProcessingHandler |
||
11 | { |
||
12 | private $carbon; |
||
13 | |||
14 | protected $key; |
||
15 | protected $hostname; |
||
16 | protected $mac; |
||
17 | protected $ip; |
||
18 | |||
19 | protected $httpClient; |
||
20 | |||
21 | protected $api = 'https://logs.logdna.com/logs/ingest'; |
||
22 | |||
23 | |||
24 | /** |
||
25 | * LogDNAHandler constructor. |
||
26 | * @param null $key |
||
27 | * @param null $host |
||
28 | * @param null $mac |
||
29 | * @param null $ip |
||
30 | * @param null $httpClient |
||
31 | * @param int $level |
||
32 | * @param bool $bubble |
||
33 | */ |
||
34 | |||
35 | |||
36 | public function __construct( |
||
57 | |||
58 | /** |
||
59 | * @param Client $client |
||
60 | */ |
||
61 | |||
62 | protected function setHttpClient(Client $client) |
||
66 | |||
67 | /** |
||
68 | * Attempts to write a log item once to the LogDNA api service |
||
69 | * |
||
70 | * It's possible that we should try this 5 times as other libraries do |
||
71 | * |
||
72 | * @param array $record |
||
73 | */ |
||
74 | |||
75 | protected function write(array $record) |
||
94 | |||
95 | /** |
||
96 | * Set the default formatter to our own |
||
97 | * |
||
98 | * @return FormatterInterface |
||
99 | */ |
||
100 | |||
101 | protected function getDefaultFormatter(): FormatterInterface |
||
105 | } |
||
106 |