rabbit-digital/bugtify-laravel
最新稳定版本:v0.4
Composer 安装命令:
composer require rabbit-digital/bugtify-laravel
包简介
Error monitoring, reporting and bug notifier for Laravel
README 文档
README
What is Bugtify?
This package allows you to send error log to Discord via webhook. Allow you to track any error from your Laravel Application
Installation on Laravel
The Bugtify can be installed with Composer. Run this command:
composer require rabbit-digital/bugtify-laravel
Register our service provider in providers array in config/app.php before your AppServiceProvider::class
'providers' => [ // ... RabbitDigital\Bugtify\BugtifyServiceProvider::class, // ... ],
You just need to publish the config file of the package.
php artisan vendor:publish --provider="RabbitDigital\Bugtify\BugtifyServiceProvider" --tag=config
Configure your Discord Webhook URL in your .env file:
BUGTIFY_DISCORD_WEBHOOK=your-discord-webhook-here
If you need to avoid to send notification with the same error can configure with option below
BUGTIFY_LIMIT_ENABLED=true
Installation on Lumen
The Bugtify can be installed with Composer. Run this command:
composer require rabbit-digital/bugtify-laravel
Copy the config file (bugtify.php) to lumen config directory.
php -r "file_exists('config/') || mkdir('config/'); copy('vendor/rabbit-digital/bugtify-laravel/config/bugtify.php', 'config/bugtify.php');"
And adjust config file (config/bugtify.php) with your desired settings.
In bootstrap/app.php you will need to:
Uncomment this line if you still not did it.
$app->withFacades();
Register Bugtify service provider
$app->register(RabbitDigital\Bugtify\BugtifyServiceProvider::class);
Reporting unhandled exceptions
To ensure all unhandled exceptions are sent to Discord, set up a bugtify logging channel and add it to your logging stack in config/logging.php:
'channels' => [ 'stack' => [ 'driver' => 'stack', // Add bugtify to the stack: 'channels' => ['single', 'bugtify'], ], // ... // Create a bugtify logging channel: 'bugtify' => [ 'driver' => 'bugtify', ], ],
Laravel and Lumen version below 5.5
Laravel and Lumen version less than 5.5 not support Logger class. Need to manually add in App\Exception\Handler.php
public function report(Exception $e) { \RabbitDigital\Bugtify\Facades\Bugtify::notifyException($e); parent::report($e); }
Reporting handled exceptions
Reporting handled exceptions can be accomplished as follows:
try { // Add some error code here } catch (Exception $ex) { \RabbitDigital\Bugtify\Facades\Bugtify::notifyException($ex); }
License
The Bugtify for Laravel library is free software released under the MIT License. See LICENSE for details.
统计信息
- 总下载量: 14.96k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2022-11-14