hangjw / alarm
此包的最新版本(v1.2.1)没有可用的许可证信息。
异常报警钉钉
v1.2.1
2020-03-30 08:40 UTC
Requires
- php: ^7.1.3
- guzzlehttp/guzzle: ^6.3
- illuminate/container: ^5.5.0
- illuminate/contracts: ^5.5.0
- illuminate/support: ^5.5.0
This package is auto-updated.
Last update: 2024-09-29 05:08:41 UTC
README
laravel下的代码异常报警
目前支持的方式只有钉钉机器人和企业微信机器人。在钉钉或企微群组中添加钉钉机器人,将token填入alarm配置中即可。
一、安装
composer require hangjw/alarm
二、获取配置并修改
php artisan vendor:publish
三、使用
try {
dd($a);
} catch (\Exception $e) {
dd($ding->setException($e)->setIp('127.0.0.1')->setRemark('备注')->run());
}
四、在laravel中配置
在Exceptions\Handler.php的report中加入代码
public function report($request, Exception $exception)
{
$ding = \Hangjw\Alarm\Alarm::driver('ding');
$ding->setException($exception)->setRemark('测试备注')->run();
parent::report($exception);
}