Added exception name to log
This commit is contained in:
@ -30,8 +30,11 @@ class ErrorHandler
|
||||
static public function logError($exception)
|
||||
{
|
||||
$error = 0;
|
||||
$exception_name = '';
|
||||
if ($exception instanceof ErrorException) {
|
||||
$error = $exception->getSeverity();
|
||||
} else {
|
||||
$exception_name = get_class($exception) . ': ';
|
||||
}
|
||||
|
||||
switch ($error) {
|
||||
@ -48,7 +51,7 @@ class ErrorHandler
|
||||
$error = 'Unknown Error';
|
||||
break;
|
||||
}
|
||||
$message = 'PHP ' . $error . ': ' . $exception->getMessage() . ' in ' . $exception->getFile() . ':' . $exception->getLine() . ' \nStack trace:\n' . $exception->getTraceAsString() . self::getHTTPErrorConditions();
|
||||
$message = 'PHP ' . $error . ': ' . $exception_name . $exception->getMessage() . ' in ' . $exception->getFile() . ':' . $exception->getLine() . ' \nStack trace:\n' . $exception->getTraceAsString() . self::getHTTPErrorConditions();
|
||||
// PHP Fatal error: Uncaught exception 'LogicException' in /www/test.tfs/face/htdocs/index.php:11\nStack trace:\n#0 {main}\n thrown in /www/test.tfs/face/htdocs/index.php on line 11, referer: http://test.tfs.manekeno.netmonsters.ru/news/create
|
||||
error_log($message);
|
||||
}
|
||||
|
Reference in New Issue
Block a user