hangjw / alarm
ding alarm for exception
Installs: 698
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/hangjw/alarm
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: 2025-09-29 02:42:11 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);
}