guanguans / laravel-exception-notify
Exception monitoring alarm notification in Laravel(Bark、Chanify、DingTalk、Discord、FeiShu、Mail、PushDeer、QQ Channel Bot、ServerChan、Slack、Telegram、WeWork、XiZhi).
Fund package maintenance!
Wechat
Installs: 17 966
Dependents: 1
Suggesters: 0
Security: 0
Stars: 93
Watchers: 2
Forks: 9
Open Issues: 2
Requires
- php: >=7.4
- ext-json: *
- guanguans/notify: ^1.28
- illuminate/contracts: ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
- illuminate/support: ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
Requires (Dev)
- brainmaestro/composer-git-hooks: ^2.8
- ergebnis/composer-normalize: ^2.42
- friendsofphp/php-cs-fixer: ^3.51
- guanguans/ai-commit: dev-main
- guanguans/monorepo-builder-worker: ^1.4
- kubawerlos/php-cs-fixer-custom-fixers: ^3.21
- laravel/lumen-framework: ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
- mockery/mockery: ^1.6
- orchestra/testbench: ^5.0 || ^6.0 || ^7.0 || ^8.0
- pestphp/pest: ^1.23 || ^2.0
- pestphp/pest-plugin-faker: ^1.0 || ^2.0
- pestphp/pest-plugin-laravel: ^1.2 || ^2.0
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- rector/rector: ^1.0
- vimeo/psalm: ^5.23
- dev-main / 3.x-dev
- 3.6.0
- 3.5.3
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.2
- 3.0.1
- 3.0.0
- 3.0.0-rc2
- 3.0.0-rc1
- 3.0.0-beta1
- 2.x-dev
- v2.16.0
- v2.15.0
- v2.14.4
- v2.14.3
- v2.14.2
- v2.14.1
- v2.14.0
- v2.13.0
- v2.12.0
- v2.11.5
- v2.11.4
- v2.11.3
- v2.11.2
- v2.11.1
- v2.11.0
- v2.10.0
- v2.9.0
- v2.8.0
- v2.7.1
- v2.7.0
- v2.6.3
- v2.6.2
- v2.6.1
- v2.6.0
- v2.5.1
- v2.5.0
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- 1.x-dev
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.12
- v1.1.11
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-dependabot/github_actions/dependabot/fetch-metadata-2.0.0
- dev-issue-59-upgrade_dependencies_guanguans/notify_to_2_x
- dev-issue-55-vscode打开项目提示如下错误
This package is auto-updated.
Last update: 2024-03-22 21:51:15 UTC
README
Exception monitoring alarm notification in Laravel(Bark、Chanify、DingTalk、Discord、FeiShu、Mail、PushDeer、QQ Channel Bot、ServerChan、Slack、Telegram、WeWork、XiZhi).
Feature
- 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
Related Links
Requirement
- PHP >= 7.4
Installation
composer require guanguans/laravel-exception-notify -v
Configuration
Register service
laravel
php artisan vendor:publish --provider="Guanguans\\LaravelExceptionNotify\\ExceptionNotifyServiceProvider"
lumen
Add the following snippet to the bootstrap/app.php
file under the Register Service Providers
section as follows:
$app->register(\Guanguans\LaravelExceptionNotify\ExceptionNotifyServiceProvider::class);
Apply for channel token
or secret
information
Configure channels in the config/exception-notify.php
or .env
file
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); }
Usage
Test for exception notify
php artisan exception-notify:test
Notification example(Xi Zhi)
1 | 2 | 3 |
---|---|---|
Extend custom channel
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`. }); }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
Thanks
License
The MIT License (MIT). Please see License File for more information.