From 9f8b4f935768d938891ced5b4f50021858a764b8 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 16 Nov 2017 15:43:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=B8=AA=E6=97=A5=E5=BF=97=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=94=AF=E6=8C=81=E5=A4=A7=E5=B0=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/log/driver/File.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/log/driver/File.php b/library/think/log/driver/File.php index 98f117af..37d2ca8d 100644 --- a/library/think/log/driver/File.php +++ b/library/think/log/driver/File.php @@ -20,10 +20,10 @@ class File { protected $config = [ 'time_format' => ' c ', + 'single' => false, 'file_size' => 2097152, 'path' => LOG_PATH, 'apart_level' => [], - 'single' => false, ]; protected $writed = []; @@ -84,7 +84,7 @@ class File protected function write($message, $destination, $apart = false) { //检测日志文件大小,超过配置大小则备份日志文件重新生成 - if (!$this->config['single'] && is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) { + if (is_file($destination) && floor($this->config['file_size']) <= filesize($destination)) { rename($destination, dirname($destination) . DS . time() . '-' . basename($destination)); $this->writed[$destination] = false; }