Skip to content

Commit 3ba01ec

Browse files
committed
Log with exception URL
1 parent e7e47cb commit 3ba01ec

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

lhc_web/lib/core/lhcore/lhmodule.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,12 @@ public static function defaultExceptionHandler($e)
246246

247247
include_once('design/defaulttheme/tpl/lhkernel/fatal_error.tpl.php');
248248

249-
if (file_exists('cache/default.log') && (filesize('cache/default.log')/1000) > 200){
250-
file_put_contents('cache/default.log', date('M j H:i:s') . ' [Warning] [default] [default] '. print_r($e,true));
249+
$requestUrl = isset($_SERVER['REQUEST_URI']) ? ' [URL: ' . $_SERVER['REQUEST_URI'] . ']' : '';
250+
251+
if (file_exists('cache/default.log') && (filesize('cache/default.log')/1000) > 200) {
252+
file_put_contents('cache/default.log', date('M j H:i:s') . ' [Warning] [default] [default]' . $requestUrl . ' '. print_r($e,true));
251253
} else {
252-
file_put_contents('cache/default.log',date('M j H:i:s') . ' [Warning] [default] [default] '. print_r($e,true), FILE_APPEND);
254+
file_put_contents('cache/default.log',date('M j H:i:s') . ' [Warning] [default] [default]' . $requestUrl . ' '. print_r($e,true), FILE_APPEND);
253255
}
254256

255257
self::logException($e);

0 commit comments

Comments
 (0)