From 42e75f50ff1a9247fc91c9889adcefc79bc78c11 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 11 Jul 2020 10:10:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/catch.php | 24 +++++++++++++++++++---- extend/catcher/library/crontab/Master.php | 7 +------ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/config/catch.php b/config/catch.php index 8714b2a..48cce93 100644 --- a/config/catch.php +++ b/config/catch.php @@ -94,10 +94,26 @@ return [ * 日志记录 */ 'log' => [ - /** - * 错误日志 - */ - 'error_log' => runtime_path('catch/schedule') . 'schedule-error.log', + // 日志记录方式 + 'type' => 'File', + // 日志保存目录 + 'path' => runtime_path('catch/schedule'), + // 单文件日志写入 + 'single' => false, + // 独立日志级别 + 'apart_level' => [], + // 最大日志文件数量 + 'max_files' => 0, + // 使用JSON格式记录 + 'json' => false, + // 日志处理 + 'processor' => null, + // 关闭通道日志写入 + 'close' => false, + // 日志输出格式化 + 'format' => '[%s][%s] %s', + // 是否实时写入 + 'realtime_write' => false, ], 'schedule_kernel' => \catcher\library\ScheduleKernel::class, diff --git a/extend/catcher/library/crontab/Master.php b/extend/catcher/library/crontab/Master.php index c25f747..55d9c54 100644 --- a/extend/catcher/library/crontab/Master.php +++ b/extend/catcher/library/crontab/Master.php @@ -268,14 +268,9 @@ class Master */ protected function initLog() { - $log = config('log.channels.file'); - - $log['path'] = config('catch.schedule.store_path'); - $channels = config('log.channels'); - $channels['schedule'] = $log; - + $channels['schedule'] = config('catch.schedule.log');; config([ 'channels' => $channels,