saviorlv/yii2-dingtalk-exception

0.0.2 2018-09-30 06:16 UTC

This package is auto-updated.

Last update: 2024-11-10 11:09:40 UTC


README

说明

yii2 日志自动发送到钉钉 实时监控服务是否运行正常

安装

composer require saviorlv/yii2-dingtalk-exception

配置

在使用本扩展之前,你需要去 群机器人 获取相关信息。

使用

在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'] @部分人员