saviorLv 2018-09-30 14:28:13 4304次浏览 2条评论 0 1 0

yii2-dingtalk-exception

说明

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

觉得很赞
  • 评论于 2018-11-26 10:30 举报
  • 评论于 2021-04-27 15:33 举报

    Problem 1

    - saviorlv/yii2-dingtalk[dev-master, 0.0.1, ..., 0.0.2] require guzzlehttp/guzzle ^6.3 -> found guzzlehttp/guzzle[6.3.0, ..., 6.5.x-dev] but the package is fixed to
    

    7.1.x-dev (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

    - saviorlv/yii2-dingtalk-exception dev-master requires saviorlv/yii2-dingtalk  -> satisfiable by saviorlv/yii2-dingtalk[dev-master, 0.0.1, 0.0.2].
    - Root composer.json requires saviorlv/yii2-dingtalk-exception dev-master -> satisfiable by saviorlv/yii2-dingtalk-exception[dev-master].
    

    Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

    3 条回复
    评论于 2021-05-08 10:18 回复

    哈哈哈,好久没上账号了,稍等我看看

    评论于 2021-05-08 10:19 回复

    你用的yii2 是哪个版本的

    评论于 2021-05-08 11:05 回复

    您删除composer.lock 执行 composer update 再试一下 或者提升php版本试一下 我刚刚在php7.4 yii2.0.42.1 测试正常的

您需要登录后才可以评论。登录 | 立即注册