Exception monitoring alarm notification in Laravel(Bark、Chanify、DingTalk、Discord、FeiShu、Mail、PushDeer、QQ Channel Bot、ServerChan、Slack、Telegram、WeWork、XiZhi).
- Monitor and send laravel application exception
- Support for multi-channel notification
- Support for extending custom channel
- Support for custom data collector
- Support for custom data pipe
- Support for notification rate limiting
- PHP >= 7.4
composer require guanguans/laravel-exception-notify -v
php artisan vendor:publish --provider="Guanguans\\LaravelExceptionNotify\\ExceptionNotifyServiceProvider"
Add the following snippet to the bootstrap/app.php
file under the Register Service Providers
section as follows:
$app->register(\Guanguans\LaravelExceptionNotify\ExceptionNotifyServiceProvider::class);
EXCEPTION_NOTIFY_DEFAULTS=dingTalk,log,...
EXCEPTION_NOTIFY_DINGTALK_KEYWORD=keyword # optional
EXCEPTION_NOTIFY_DINGTALK_TOKEN=c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d
EXCEPTION_NOTIFY_DINGTALK_SECRET=SECc32bb7345c0f73da2b9786f0f7dd5083bd768a29b82 # optional
Laravel7 and below versions and lumen need to be added to the report
method of app/Exceptions/Handler.php
public function report(Throwable $exception)
{
\Guanguans\LaravelExceptionNotify\Facades\ExceptionNotify::reportIf($this->shouldReport($exception), $exception);
parent::report($exception);
}
php artisan exception-notify:test
1 | 2 | 3 |
---|---|---|
Modify the boot
method in the app/Providers/AppServiceProvider.php
file
public function boot()
{
\ExceptionNotifier::extend('YourChannel', function (\Illuminate\Contracts\Container\Container $container){
// return instance of the `\Guanguans\LaravelExceptionNotify\Contracts\ChannelContract`.
});
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.