yii2 日志自动发送到钉钉 实时监控服务是否运行正常
composer require saviorlv/yii2-dingtalk-exception
在使用本扩展以前,你须要去 群机器人 获取相关信息。php
在config/main.php配置文件中定义component配置信息
'components' => [ ...... 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' => ['error', 'warning'], ], [ 'class' => 'Saviorlv\Log\ExceptionTarget', 'levels' => ['error', 'warning'], 'options' => [ 'accessToken' => 'xxxxxxxx', 'isAtAll' => false, 'atMobiles' => ['136xxxx5134'] ], ], ], ], ...... ]
'isAtAll' => true
@全部人 'atMobiles' => ['136xxxx5134','136xxxx5133']
@部分人员api