File tree 4 files changed +17
-13
lines changed
4 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 16
16
}
17
17
},
18
18
"require" : {
19
- "php" : " ^7.3|^7.4|^8.0" ,
20
- "illuminate/support" : " ~5.6|^6.0|^7.0|^8.0|^9.0|^10.0"
19
+ "php" : " ^8.1" ,
20
+ "illuminate/support" : " ^10.0" ,
21
+ "monolog/monolog" : " ^3.0"
21
22
},
22
23
"extra" : {
23
24
"laravel" : {
Original file line number Diff line number Diff line change 6
6
* Add the local user ID to extra if a user is logged in.
7
7
*/
8
8
9
- use Monolog \Processor \ ProcessorInterface ;
9
+ use Monolog \LogRecord ;
10
10
use Monolog \ResettableInterface ;
11
+ use Monolog \Processor \ProcessorInterface ;
11
12
12
13
class AppNameProcessor implements ProcessorInterface
13
14
{
@@ -20,16 +21,16 @@ public function __construct()
20
21
$ this ->subsystem = config ('app.subsystem ' );
21
22
}
22
23
23
- public function __invoke (array $ record )
24
+ public function __invoke (LogRecord $ record )
24
25
{
25
26
// Add system and subsystem names.
26
27
27
28
if ($ this ->application ) {
28
- $ record[ ' extra ' ] ['application ' ] = $ this ->application ;
29
+ $ record-> extra ['application ' ] = $ this ->application ;
29
30
}
30
31
31
32
if ($ this ->subsystem ) {
32
- $ record[ ' extra ' ] ['subsystem ' ] = $ this ->subsystem ;
33
+ $ record-> extra ['subsystem ' ] = $ this ->subsystem ;
33
34
}
34
35
35
36
return $ record ;
Original file line number Diff line number Diff line change 6
6
* Add the local user ID to extra if a user is logged in.
7
7
*/
8
8
9
- use Monolog \Processor \ProcessorInterface ;
9
+ use Throwable ;
10
+ use Monolog \LogRecord ;
10
11
use Monolog \ResettableInterface ;
11
12
use Illuminate \Support \Facades \Auth ;
12
- use Throwable ;
13
+ use Monolog \ Processor \ ProcessorInterface ;
13
14
14
15
class AuthUserProcessor implements ProcessorInterface, ResettableInterface
15
16
{
16
17
protected $ userId ;
17
18
18
- public function __invoke (array $ record )
19
+ public function __invoke (LogRecord $ record )
19
20
{
20
21
if ($ userId = $ this ->getUserId ()) {
21
- $ record[ ' extra ' ] ['local_user_id ' ] = $ userId ;
22
+ $ record-> extra ['local_user_id ' ] = $ userId ;
22
23
}
23
24
24
25
return $ record ;
Original file line number Diff line number Diff line change 6
6
* Add the currently running job name to the log messages.
7
7
*/
8
8
9
- use Monolog \Processor \ ProcessorInterface ;
9
+ use Monolog \LogRecord ;
10
10
use Monolog \ResettableInterface ;
11
+ use Monolog \Processor \ProcessorInterface ;
11
12
use Consilience \Laravel \ExtendedLogging \LoggingService ;
12
13
13
14
class JobNameProcessor implements ProcessorInterface
14
15
{
15
- public function __invoke (array $ record )
16
+ public function __invoke (LogRecord $ record )
16
17
{
17
18
$ jobName = app (LoggingService::class)->getJobName ();
18
19
19
20
if ($ jobName ) {
20
- $ record[ ' extra ' ] ['job_name ' ] = $ jobName ;
21
+ $ record-> extra ['job_name ' ] = $ jobName ;
21
22
}
22
23
23
24
return $ record ;
You can’t perform that action at this time.
0 commit comments