This commit is contained in:
Александр Рыбкин 2024-11-25 16:40:21 +03:00
parent 428729ebf7
commit bbe560277d
1 changed files with 3 additions and 6 deletions

View File

@ -44,7 +44,6 @@ class Loger extends FileTarget
public function formatMessage($result)
{
$output = '';
$url = '';
$post = '';
@ -70,10 +69,10 @@ class Loger extends FileTarget
break;
case 'json':
$error = $result[0];
if(is_a($error, 'Exception'))
if(is_a($error, 'Exception') || is_a($error, '\Error'))
{
$message = $error->getMessage() . ' in '.$error->getFile().':'.$error->getLine();
$output = json_encode([
$output .= json_encode([
'date' => date('Y-m-d H:i:s'),
'url' => $url,
'message' => $message ,
@ -85,10 +84,8 @@ class Loger extends FileTarget
}
else
{
// $output = print_r($result, true);
$output .= parent::formatMessage($result);
}
// var_dump($output);
break;
case 'result':
default :