From bbe560277d3262346ed8f6fdf8fae34778df7aef Mon Sep 17 00:00:00 2001 From: Sasha Rybkin Date: Mon, 25 Nov 2024 16:40:21 +0300 Subject: [PATCH] fix --- Loger.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Loger.php b/Loger.php index 45fab25..ee96dfe 100644 --- a/Loger.php +++ b/Loger.php @@ -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 :