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 :