From 522399703190281387eb9d609da26453f25bbf2c Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Sun, 20 Sep 2020 09:50:48 +0800 Subject: [PATCH] =?UTF-8?q?update:=E4=BC=98=E5=8C=96=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catch/monitor/command/process/Master.php | 2 +- catch/monitor/model/search/CrontabLogSearch.php | 2 +- catch/monitor/module.json | 2 +- extend/catcher/base/CatchCronTask.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/catch/monitor/command/process/Master.php b/catch/monitor/command/process/Master.php index 9202ef3..bf5c60f 100644 --- a/catch/monitor/command/process/Master.php +++ b/catch/monitor/command/process/Master.php @@ -154,7 +154,7 @@ class Master } } catch (\Throwable $exception) { // todo - echo $exception->getMessage(); + echo sprintf('[%s]: ', date('Y-m-d H:i:s')) . $exception->getMessage(); } } diff --git a/catch/monitor/model/search/CrontabLogSearch.php b/catch/monitor/model/search/CrontabLogSearch.php index 7ff03ab..29a46be 100644 --- a/catch/monitor/model/search/CrontabLogSearch.php +++ b/catch/monitor/model/search/CrontabLogSearch.php @@ -24,7 +24,7 @@ trait CrontabLogSearch public function searchStatusAttr($query, $value, $data) { - return $query->where('status', $value); + return $query->where('crontab_log.status', $value); } public function searchStartAtAttr($query, $value, $data) diff --git a/catch/monitor/module.json b/catch/monitor/module.json index b11be66..92164af 100644 --- a/catch/monitor/module.json +++ b/catch/monitor/module.json @@ -11,5 +11,5 @@ "aliases": [], "files": [], "requires": [], - "enable": false + "enable": true } \ No newline at end of file diff --git a/extend/catcher/base/CatchCronTask.php b/extend/catcher/base/CatchCronTask.php index e6aa84f..365d788 100644 --- a/extend/catcher/base/CatchCronTask.php +++ b/extend/catcher/base/CatchCronTask.php @@ -50,9 +50,9 @@ abstract class CatchCronTask return true; } catch (\Throwable $e) { $this->dealWithException($e); - echo 'File:' . $e->getFile() . ', Lines: '. $e->getLine() .'行,Exception Message: ' . $e->getMessage() . PHP_EOL; + echo sprintf('[%s]: ', date('Y-m-d H:i:s')) . 'File:' . $e->getFile() . ', Lines: '. $e->getLine() .'行,Exception Message: ' . $e->getMessage() . PHP_EOL; // 输出堆栈信息 - echo $e->getTraceAsString() . PHP_EOL; + echo sprintf('[%s]: ', date('Y-m-d H:i:s')) . $e->getTraceAsString() . PHP_EOL; // 日志记录 $this->recordLog($startAt, 'File:' . $e->getFile() . ', Lines: '. $e->getLine() .'行,Exception Message: ' . $e->getMessage()); $this->exceptionHappenTimes += 1;