From 618fb517888ad6baf03915316f1786fc52ffc6b9 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 23 Jan 2018 15:12:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E6=97=A5=E5=BF=97=E5=86=99?= =?UTF-8?q?=E5=85=A5=E5=B9=B6=E5=8F=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/log/driver/File.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/think/log/driver/File.php b/library/think/log/driver/File.php index 236e21bd..4036cc44 100644 --- a/library/think/log/driver/File.php +++ b/library/think/log/driver/File.php @@ -86,7 +86,10 @@ class File { //检测日志文件大小,超过配置大小则备份日志文件重新生成 if (is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) { - rename($destination, dirname($destination) . DS . time() . '-' . basename($destination)); + try { + rename($destination, dirname($destination) . DS . time() . '-' . basename($destination)); + } catch (\Exception $e) { + } $this->writed[$destination] = false; }