Details |
Letzte Änderung |
Log anzeigen
| RSS feed
| Revision |
Autor |
Zeilennr. |
Zeile |
| 199 |
lars |
1 |
<?php namespace Clockwork\Support\Monolog\Monolog2;
|
|
|
2 |
|
|
|
3 |
use Clockwork\Request\Log as ClockworkLog;
|
|
|
4 |
|
|
|
5 |
use Monolog\Logger;
|
|
|
6 |
use Monolog\Handler\AbstractProcessingHandler;
|
|
|
7 |
|
|
|
8 |
// Stores messages in a Clockwork log instance (compatible with Monolog 2.x)
|
|
|
9 |
class ClockworkHandler extends AbstractProcessingHandler
|
|
|
10 |
{
|
|
|
11 |
protected $clockworkLog;
|
|
|
12 |
|
|
|
13 |
public function __construct(ClockworkLog $clockworkLog)
|
|
|
14 |
{
|
|
|
15 |
parent::__construct();
|
|
|
16 |
|
|
|
17 |
$this->clockworkLog = $clockworkLog;
|
|
|
18 |
}
|
|
|
19 |
|
|
|
20 |
protected function write(array $record): void
|
|
|
21 |
{
|
|
|
22 |
$this->clockworkLog->log($record['level'], $record['message']);
|
|
|
23 |
}
|
|
|
24 |
}
|