File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/Instrumentation/Laravel/src/Watchers 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
22
22
{
23
23
/** @phan-suppress-next-line PhanTypeArraySuspicious */
24
24
$ app ['events ' ]->listen (MessageLogged::class, [$ this , 'recordLog ' ]);
25
+
26
+ /** @phan-suppress-next-line PhanTypeArraySuspicious */
27
+ $ this ->logger = $ app ['log ' ];
25
28
}
26
29
27
30
/**
28
31
* Record a log.
29
32
*/
30
33
public function recordLog (MessageLogged $ log ): void
31
34
{
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
+
32
42
$ attributes = [
33
43
'context ' => json_encode (array_filter ($ log ->context )),
34
44
];
You can’t perform that action at this time.
0 commit comments