File tree Expand file tree Collapse file tree 3 files changed +49
-0
lines changed
Clockwork/Support/Monolog Expand file tree Collapse file tree 3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 66use Monolog \Handler \AbstractProcessingHandler ;
77
88// Stores messages in a Clockwork log instance
9+ // DEPRECATED Moved to Clockwork\Support\Monolog\Monolog\ClockworkHandler, will be removed in Clockwork 6
910class ClockworkHandler extends AbstractProcessingHandler
1011{
1112 protected $ clockworkLog ;
Original file line number Diff line number Diff line change 1+ <?php namespace Clockwork \Support \Monolog \Monolog ;
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 1.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 )
21+ {
22+ $ this ->clockworkLog ->log ($ record ['level ' ], $ record ['message ' ]);
23+ }
24+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments