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