rob-lester-jr04/laravel-health-expansion
最新稳定版本:1.0.1
Composer 安装命令:
composer require rob-lester-jr04/laravel-health-expansion
包简介
An expansion pack for Spatie Laravel Health package
README 文档
README
Using this package to add more health checks to Spatie Health Checks for Laravel.
Installation
composer require rob-lester-jr04/laravel-health-expansion
Laravel will automatically register the service provider.
Here's an example where we'll monitor errors in PaperTrail.
// typically, in a service provider use Spatie\Health\Facades\Health; use Lester\Health\Checks\Checks\PaperTrailCheck; Health::checks([ PaperTrailCheck::new() ->onSystem('my-system-1'), ]);
By default, this will report a failure if there are more than 20 errors in the default time frame (10 minutes). It will report a warning if there are more than 10, and it will report as ok if the error count is under 10. The thresholds can be changed with the following methods:
...highCount(); ...lowCount(); // Change time frame (in minutes) ...lastMinutes();
Available Checks
This package also contains the following checks:
- MailgunDomainCheck
- This check will get the status for your mailgun domain(s) so you can monitor if mailgun has flagged your deliverability.
- ApiCheck
- This check allows you to get the laravel health from another application. Useful for creating a permenant dashboard screen that monitors all your other systems.
- PaperTrailCheck
- Scans PaperTrail logs for a set number of errors in a set time frame.
Using the MailGun domain check
First, set the API key in the .env file.
MAILGUN_SECRET=########
Then enable the check in the service provider
use Spatie\Health\Facades\Health; use Lester\Health\Checks\Checks\MailgunDomainCheck; Health::checks([ // ... MailgunDomainCheck::new() ->domain('mg.example.com'), // ... ]);
Testing
composer test
统计信息
- 总下载量: 13.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-06-22