1 | <?php |
||
11 | class MonologTarget extends Target |
||
12 | { |
||
13 | /** |
||
14 | * @var Logger |
||
15 | */ |
||
16 | private $logger; |
||
17 | |||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | private $handlers = []; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | private $processors = []; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $channel = 'main'; |
||
32 | |||
33 | /** |
||
34 | * @var MonologFactory |
||
35 | */ |
||
36 | private $monologFactory; |
||
37 | |||
38 | /** |
||
39 | * Initializes a new MonologTarget. |
||
40 | * |
||
41 | * @param MonologFactory $monologFactory |
||
42 | * @param array $config |
||
43 | */ |
||
44 | 1 | public function __construct(MonologFactory $monologFactory, $config = []) |
|
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | * @throws \InvalidArgumentException |
||
53 | * @throws \yii\base\InvalidConfigException |
||
54 | */ |
||
55 | 1 | public function init() |
|
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | 1 | public function export() |
|
75 | |||
76 | /** |
||
77 | * @param array $handlers |
||
78 | */ |
||
79 | 1 | public function setHandlers(array $handlers): void |
|
83 | |||
84 | /** |
||
85 | * @param array $processors |
||
86 | */ |
||
87 | 1 | public function setProcessors(array $processors): void |
|
91 | |||
92 | /** |
||
93 | * @param string $channel |
||
94 | */ |
||
95 | 1 | public function setChannel(string $channel): void |
|
99 | |||
100 | /** |
||
101 | * Returns the messages from the Target wrapped in Yii2LogMessage. |
||
102 | * |
||
103 | * @return Yii2LogMessage[]|array |
||
104 | */ |
||
105 | 1 | private function getMessages(): array |
|
114 | } |
||
115 |