

yii-log-target - 监控系统异常且多渠道发送异常信息通知
source link: https://segmentfault.com/a/1190000040027885
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

yii-log-target - 监控系统异常且多渠道发送异常信息通知
yii-log-target - 监控系统异常且多渠道发送异常信息通知(Bark、Chanify、钉钉群机器人、飞书群机器人、Server 酱、企业微信群机器人、息知)。
- PHP >= 7.2
- yiisoft/yii2 > 2.0
$ composer require guanguans/yii-log-target --prefer-dist -vvv
Yii2 配置文件 config/main.php
的日志组件中配置:
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
// // Bark
// [
// 'class' => \Guanguans\YiiLogTarget\BarkTarget::class,
// 'levels' => ['error'],
// // 'debug' => true,
// 'token' => 'PXb8KDj9dHStfQ5cGJ5',
// ],
//
// // Chanify
// [
// 'class' => \Guanguans\YiiLogTarget\ChanifyTarget::class,
// 'levels' => ['error'],
// // 'debug' => true,
// 'token' => 'P3IgGEiJBQVdIWlVKS1JORVY0UlVETFZYVVpRTlNLTlVZVlZPT1JFGhR7vAyf8Uj5UQhhK4n6QfVzih96QyIECAEQAQ.G4z2i0VZP7lOiCKYif4LOXu3cBdizl-PLWYn_7zrGXQ',
// ],
//
// 钉钉群机器人
[
'class' => \Guanguans\YiiLogTarget\DingTalkTarget::class,
'levels' => ['error'],
// 'debug' => true,
'keyword' => 'keyword',
'token' => 'fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73eeb',
// 'secret' => 'SECc32bb7345c0f73da2b9786f0f7dd5083bd768a29b82e6d460149d730eee51730',
],
//
// // 飞书群机器人
// [
// 'class' => \Guanguans\YiiLogTarget\FeiShuTarget::class,
// 'levels' => ['error'],
// // 'debug' => true,
// 'keyword' => 'keyword',
// 'token' => 'b70d9-6e19-4f87-af48-348b0281866c',
// // 'secret' => 'iigDOvnsIn6aFS1pYHHEHh',
// ],
//
// // Server 酱
// [
// 'class' => \Guanguans\YiiLogTarget\ServerChanTarget::class,
// 'levels' => ['error'],
// // 'debug' => true,
// 'token' => '35149Thtf1g2Bc14QJuQ6HFpW5YGXm',
// ],
//
// // 企业微信群机器人
// [
// 'class' => \Guanguans\YiiLogTarget\WeWorkTarget::class,
// 'levels' => ['error'],
// // 'debug' => true,
// 'token' => '3d5a3-ceff-4da8-bcf3-ff5891778fb7',
// ],
//
// // 息知
// [
// 'class' => \Guanguans\YiiLogTarget\XiZhiTarget::class,
// 'levels' => ['error'],
// // 'debug' => true,
// 'token' => '60aea56567ae39a1b1920cbc42bb5bd',
// ],
],
],
Yii::error('测试');
Recommend
-
87
导火索 有一天一个测试同事的一个移动端页面白屏了,看样子是页面哪里报错了。 我自己打开页面并没有报错,最后发现报错只存在于他的手机,移动端项目又是在微信环境下,调试起来会比较麻烦,最后用他手机调试才发现问题: 是他账户...
-
73
背景 最近,刚到新公司,对公司产品进行前端重构;在来公司近一个月中,发现以前产品问题很多,尤其兼容性问题等;在以前项目中也会经常遇到,可能因为某个兼容性问题,导致js代码出错,从而导致整个应用无法运行;但市场上,无论是pc端还是移动端,会有各种不同的...
-
51
Prometheus Alert 是开源的运维告警中心消息转发系统,支持主流的监控系统 Prometheus ,日志系统 Graylog 和数据可视化系统 Grafana 发出的预警消息。通知渠道支持钉钉、微信、华...
-
12
前端异常监控系统的落地前端开发话题下的优秀回答者在后端服务中,错误或者业务日志的记录是非常常见的一种习惯,它可以帮助开发者快速定位系统的状态、追查 bug,了解异常情况等...
-
5
-i --icon=ICON[,ICON...] 指定显示通知的图标. 其中ICON既可以是一个指向图标文件的路径,也可以是标准图标的名称. 其中标准图标名称一般包括以下这些: Standard Action Icons Name Description address-...
-
7
常见的告警方式有:邮件,电话,短信,微信。 短信和电话,通常是收费的(若你有不收费的,可以评论分享一下),而邮件又不是那么及时,因此最后我选择微信通知。 这里说的微信,是企业微信,而我之前用注册过个体户的执照,因此可以很轻松就可...
-
8
重磅通知!亚马逊将于5月9日上调多渠道配送费用! ...
-
5
一、通知方式有哪些? 常见的通知方式有:邮件,电话,短信,微信。 短信和电话:通常是收费的,较少使用; 邮件:适合带文件类型的通知,较正式,存档使用; 微信:适合告警类型通知,较方便。这里说的微信,是企业微信。
-
4
如何用 Python 发送通知到微信? AI科技大本营 2022年4月12日06时
-
6
01业务背景及目的一般的异常数据上报只支持简单的接口状态码是否异常等基础上报,对于某些核心字段,下发值缺失导致崩溃异常不能更精细的定位。为此,阿波罗移动端设计了此业务异常监控sdk,使前后端快速配合定位问题,及时监控捕捉...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK