File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,23 @@ public function register(Application $app): void
2222 {
2323 /** @phan-suppress-next-line PhanTypeArraySuspicious */
2424 $ app ['events ' ]->listen (MessageLogged::class, [$ this , 'recordLog ' ]);
25+
26+ /** @phan-suppress-next-line PhanTypeArraySuspicious */
27+ $ this ->logger = $ app ['log ' ];
2528 }
2629
2730 /**
2831 * Record a log.
2932 */
3033 public function recordLog (MessageLogged $ log ): void
3134 {
35+ $ underlyingLogger = $ this ->logger ->getLogger ();
36+
37+ /** @phan-suppress-next-line PhanUndeclaredMethod */
38+ if (method_exists ($ underlyingLogger , 'isHandling ' ) && !$ underlyingLogger ->isHandling ($ log ->level )) {
39+ return ;
40+ }
41+
3242 $ attributes = [
3343 'context ' => json_encode (array_filter ($ log ->context )),
3444 ];
You can’t perform that action at this time.
0 commit comments