优化日志记录;

This commit is contained in:
2022-03-19 13:10:02 +08:00
parent 19fa150e57
commit 01adf4261b
2 changed files with 30 additions and 4 deletions

View File

@@ -1,14 +1,25 @@
<?php
use think\facade\Env;
// +----------------------------------------------------------------------
// | 日志设置
// +----------------------------------------------------------------------
$level = [];
if (!env('app_debug')) {
$level = ['error'];
}
return [
// 默认日志记录通道
'default' => Env::get('log.channel', 'debug_mysql'),
// 日志记录级别
'level' => [],
'level' => $level,
// 日志类型记录的通道 ['error'=>'email',...]
'type_channel' => [],
// 关闭全局日志写入
@@ -60,7 +71,7 @@ return [
'charset' => Env::get('database.charset', 'utf8'),
// 数据库表前缀
'prefix' => Env::get('database.prefix', 'ul_'),
]
]
],
];