From 1d7dd95475db7d2943e4f8fe83e55d5082b64f33 Mon Sep 17 00:00:00 2001 From: augushong Date: Wed, 27 Aug 2025 22:58:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/log.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/config/log.php b/config/log.php index d5b894c..9b2cbd6 100644 --- a/config/log.php +++ b/config/log.php @@ -5,11 +5,19 @@ use think\facade\Env; // +---------------------------------------------------------------------- // | 日志设置 // +---------------------------------------------------------------------- + + +$level = []; + +if (!Env::get('APP_DEBUG')) { + $level = ['error', 'info', 'notice', 'warning', 'critical', 'alert', 'emergency']; +} + return [ // 默认日志记录通道 - 'default' => Env::get('log.channel', 'debug_mysql'), + 'default' => Env::get('log.channel', 'file'), // 日志记录级别 - 'level' => [], + 'level' => $level, // 日志类型记录的通道 ['error'=>'email',...] 'type_channel' => [], // 关闭全局日志写入