| 1 | <?php |
||
| 11 | class MonologTarget extends Target |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var Logger |
||
| 15 | */ |
||
| 16 | private $logger; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | private $channel = null; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var LoggerRegistry |
||
| 25 | */ |
||
| 26 | private $loggerRegistry; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Initializes a new MonologTarget. |
||
| 30 | * |
||
| 31 | * @param LoggerRegistry $loggerRegistry |
||
| 32 | * @param array $config |
||
| 33 | */ |
||
| 34 | 3 | public function __construct(LoggerRegistry $loggerRegistry, $config = []) |
|
| 39 | |||
| 40 | /** |
||
| 41 | * {@inheritdoc} |
||
| 42 | * @throws \InvalidArgumentException |
||
| 43 | * @throws \yii\base\InvalidConfigException |
||
| 44 | */ |
||
| 45 | 3 | public function init() |
|
| 51 | |||
| 52 | /** |
||
| 53 | * {@inheritdoc} |
||
| 54 | */ |
||
| 55 | public function export() |
||
| 61 | |||
| 62 | 3 | public function setChannel(string $channel) |
|
| 66 | |||
| 67 | /** |
||
| 68 | * Returns the messages from the Target wrapped in Yii2LogMessage. |
||
| 69 | * |
||
| 70 | * @return Yii2LogMessage[]|Collection |
||
| 71 | */ |
||
| 72 | private function getMessages(): Collection |
||
| 78 | } |
||
| 79 |