File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 2323 ],
2424 "require" : {
2525 "php" : " ^8.0" ,
26- "devdot/monolog-parser" : " ^1.2 " ,
26+ "devdot/monolog-parser" : " ^1.3 " ,
2727 "illuminate/contracts" : " ^9" ,
2828 "illuminate/console" : " ^9"
2929 },
Original file line number Diff line number Diff line change @@ -160,7 +160,10 @@ protected function printRecord(LogRecord $record): void {
160160 return ;
161161 }
162162 // parse the context object
163- $ array = is_array ($ record ['context ' ]) ? $ record ['context ' ] : get_object_vars ($ record ['context ' ]);
163+ // handle the case where context is a string
164+ $ array = is_array ($ record ['context ' ])
165+ ? $ record ['context ' ]
166+ : (is_object ($ record ['context ' ]) ? get_object_vars ($ record ['context ' ]) : ['context ' => $ record ['context ' ]]);
164167 foreach ($ array as $ attribute => $ value ) {
165168 // handle exception after the loop
166169 if ($ attribute == 'exception ' )
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ public function __construct(string $filename = '') {
1313 // initialize the parser
1414 $ this ->parser = new Parser ();
1515 $ this ->parser ->setPattern (Parser::PATTERN_LARAVEL );
16+ $ this ->parser ->setOptions (Parser::OPTION_JSON_FAIL_SOFT );
1617
1718 if (!empty ($ filename )) {
1819 $ this ->setFile ($ filename );
You can’t perform that action at this time.
0 commit comments