|
|
@@ -8,6 +8,8 @@
|
|
|
namespace yii\web;
|
|
|
|
|
|
use common\helpers\DingTalk;
|
|
|
+use common\helpers\LoggerTool;
|
|
|
+use common\helpers\Tool;
|
|
|
use Yii;
|
|
|
use yii\base\ErrorException;
|
|
|
use yii\base\Exception;
|
|
|
@@ -174,6 +176,12 @@ class ErrorHandler extends \yii\base\ErrorHandler
|
|
|
$it['previous'] = $this->convertExceptionToArray($prev);
|
|
|
}
|
|
|
|
|
|
+ // 错误日志写入
|
|
|
+ $it['trace-id'] = Tool::generateId();
|
|
|
+ LoggerTool::error($it);
|
|
|
+
|
|
|
+ // 提醒只报出基本错误
|
|
|
+ unset($it['stack-trace']);
|
|
|
// 发送钉钉提醒
|
|
|
DingTalk::sendNotice($it);
|
|
|
|