From 24f3d7086e40e91f3ce5716b5ae311336587eca6 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 15 Nov 2019 12:48:53 +0800 Subject: [PATCH] logs format --- bootstrap/kernel.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bootstrap/kernel.php b/bootstrap/kernel.php index 1e0eb58..988ecfe 100644 --- a/bootstrap/kernel.php +++ b/bootstrap/kernel.php @@ -79,8 +79,10 @@ public function setting() foreach (getAllHeaders() as $key => $value) { $logs .= $key . ': ' . $value . "\n"; } - $logs .= "\n" . file_get_contents("php://input"); - $logs .= "\n_____________________________________"; + if ($body = file_get_contents("php://input")) { + $logs .= "\n" . $body . "\n"; + } + $logs .= "_____________________________________"; $this->di->get('logger', [date('Ymd')])->log($logs, Logger::INFO); }