@@ -125,16 +125,21 @@ public function exceptionHandler(Throwable $exception)
125
125
126
126
[$ statusCode , $ exitCode ] = $ this ->determineCodes ($ exception );
127
127
128
+ $ this ->request = Services::request ();
129
+
128
130
if ($ this ->config ->log === true && ! in_array ($ statusCode , $ this ->config ->ignoreCodes , true )) {
129
- log_message ('critical ' , "{message} \nin {exFile} on line {exLine}. \n{trace} " , [
130
- 'message ' => $ exception ->getMessage (),
131
- 'exFile ' => clean_path ($ exception ->getFile ()), // {file} refers to THIS file
132
- 'exLine ' => $ exception ->getLine (), // {line} refers to THIS line
133
- 'trace ' => self ::renderBacktrace ($ exception ->getTrace ()),
131
+ $ uri = $ this ->request ->getPath () === '' ? '/ ' : $ this ->request ->getPath ();
132
+ $ routeInfo = '[Method: ' . strtoupper ($ this ->request ->getMethod ()) . ', Route: ' . $ uri . '] ' ;
133
+
134
+ log_message ('critical ' , "{message} \n{routeInfo} \nin {exFile} on line {exLine}. \n{trace} " , [
135
+ 'message ' => $ exception ->getMessage (),
136
+ 'routeInfo ' => $ routeInfo ,
137
+ 'exFile ' => clean_path ($ exception ->getFile ()), // {file} refers to THIS file
138
+ 'exLine ' => $ exception ->getLine (), // {line} refers to THIS line
139
+ 'trace ' => self ::renderBacktrace ($ exception ->getTrace ()),
134
140
]);
135
141
}
136
142
137
- $ this ->request = Services::request ();
138
143
$ this ->response = Services::response ();
139
144
140
145
// Get the first exception.
0 commit comments