From 6331e1fd5a7bc92c9671a81486a50df36dd1b6ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 22 Jul 2021 16:00:05 +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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/System/Error/Logger.php b/System/Error/Logger.php index f04bc5d2..39c28811 100644 --- a/System/Error/Logger.php +++ b/System/Error/Logger.php @@ -167,7 +167,7 @@ class Logger extends Component if (!isset($this->sources[$to_day])) $this->sources[$to_day] = []; $fileName = storage('server-' . $to_day . '.log', $dirName = 'log/' . ($method ?? 'app')); - if (!isset($this->sources[$to_day][$fileName])) { + if (!isset($this->sources[$to_day][$fileName]) || !is_writeable($fileName)) { $this->sources[$to_day][$fileName] = fopen($fileName, 'rw'); } fwrite($this->sources[$to_day][$fileName], '[' . date('Y-m-d H:i:s') . ']:' . PHP_EOL . $messages . PHP_EOL);