From 2edeacdd16572ccef20d5609f60f955b0027f67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 22 Jul 2021 16:02:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Error/Logger.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/System/Error/Logger.php b/System/Error/Logger.php index 06a8c807..85a5d5a3 100644 --- a/System/Error/Logger.php +++ b/System/Error/Logger.php @@ -168,7 +168,9 @@ class Logger extends Component $fileName = storage('server-' . $to_day . '.log', $dirName = 'log/' . ($method ?? 'app')); if (!isset($this->sources[$to_day][$fileName]) || !is_writable($this->sources[$to_day][$fileName])) { - $this->sources[$to_day][$fileName] = fopen($fileName, 'rw'); + if (!($this->sources[$to_day][$fileName] = fopen($fileName, 'rw'))) { + return; + } } fwrite($this->sources[$to_day][$fileName], '[' . date('Y-m-d H:i:s') . ']:' . PHP_EOL . $messages . PHP_EOL);