Multiple channels of laravel exception notification(DingTalk、FeiShu、ServerChan、WeWork、XiZhi). - 多种通道的 laravel 异常通知。
- 监控发送 laravel 应用异常
- 支持多种通道(钉钉群机器人、飞书群机器人、Server 酱、企业微信群机器人、息知)
- 自定义发送的异常信息数据
- laravel >= 5.5
$ composer require bing-leng-dt/laravel-exception-notify-xiavan -vvv
$ php artisan vendor:publish --provider="Guanguans\\LaravelExceptionNotify\\ExceptionNotifyServiceProvider"
将以下代码段添加到 bootstrap/app.php
文件中的 Register Service Providers
部分下:
$app->register(\Guanguans\LaravelExceptionNotify\ExceptionNotifyServiceProvider::class);
config/exception-notify.php
.env
文件中配置
EXCEPTION_NOTIFY_DEFAULT_CHANNEL=dingTalk
EXCEPTION_NOTIFY_CHANNEL_KEYWORD=keyword
EXCEPTION_NOTIFY_CHANNEL_TOKEN=fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73eeb
EXCEPTION_NOTIFY_CHANNEL_SECRET=c32bb7345c0f73da2b9786f0f7dd5083bd768a29b82e6d460149d730eee51730
public function report(Exception $exception)
{
// 添加的代码
$this->shouldReport($exception) and \ExceptionNotifier::report($exception);
// // 或者
// $this->shouldReport($exception) and app('exception.notifier')->report($exception);
// // 或者
// $this->shouldReport($exception) and \Guanguans\LaravelExceptionNotify\Facades\Notifier::report($exception);
parent::report($exception);
}
$ composer test
请参阅 CHANGELOG 获取最近有关更改的更多信息。
请参阅 CONTRIBUTING 有关详细信息。
请查看我们的安全政策了解如何报告安全漏洞。
MIT 许可证(MIT)。有关更多信息,请参见协议文件。