From 338f7ad636ea0d658969004c1521b6a764e52754 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 11 Jan 2019 17:55:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/log/driver/File.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/think/log/driver/File.php b/library/think/log/driver/File.php index 400b2040..bace4c2f 100644 --- a/library/think/log/driver/File.php +++ b/library/think/log/driver/File.php @@ -154,19 +154,21 @@ class File if (PHP_SAPI == 'cli') { $info['msg'] = $msg; $info['type'] = $type; - error_log($this->parseCliLog($info), 3, $destination); } else { $info[$type] = $msg; } } - if (PHP_SAPI != 'cli') { + if (PHP_SAPI == 'cli') { + $message = $this->parseCliLog($info); + } else { // 添加调试日志 $this->getDebugLog($info, $append, $apart); $message = $this->parseLog($info); - return error_log($message, 3, $destination); } + + return error_log($message, 3, $destination); } /**