| 199 |
lars |
1 |
<?php namespace Clockwork\Support\Monolog\Handler;
|
|
|
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
|
|
|
9 |
// DEPRECATED Moved to Clockwork\Support\Monolog\Monolog\ClockworkHandler, will be removed in Clockwork 6
|
|
|
10 |
class ClockworkHandler extends AbstractProcessingHandler
|
|
|
11 |
{
|
|
|
12 |
protected $clockworkLog;
|
|
|
13 |
|
|
|
14 |
public function __construct(ClockworkLog $clockworkLog)
|
|
|
15 |
{
|
|
|
16 |
parent::__construct();
|
|
|
17 |
|
|
|
18 |
$this->clockworkLog = $clockworkLog;
|
|
|
19 |
}
|
|
|
20 |
|
|
|
21 |
protected function write(array $record)
|
|
|
22 |
{
|
|
|
23 |
$this->clockworkLog->log($record['level'], $record['message']);
|
|
|
24 |
}
|
|
|
25 |
}
|