gomagaming / health-checks
后端服务健康检查
0.0.5
2022-09-20 13:16 UTC
Requires
- gomagaming/logs: >=0.0.39
- spatie/laravel-health: ^1.12
README
描述
- GomaGaming Health Checks 允许您通过调用一个简单的端点来运行 "spatie/laravel-health",此功能还将任务结果和健康检查结果保存到 Redis 中。
- 为所有活跃/计划的 Service 任务创建/更新日志。
- 通过调用另一个简单的端点清除这些日志,指定您想要清除的天数。
- 获取任务数据 - 任务命令、标签、描述、cron 表达式、最后启动时间和最后结束时间。
Laravel 版本兼容性
- Laravel
>= 9.x.x
在 PHP>= 8.0
上
安装
composer require gomagaming/health-checks
配置文件
php artisan vendor:publish --tag=gomagaming-health-checks
php artisan vendor:publish --tag=health-config
在 config/health.php 和 bootstrap/health.php 中
- 在 "result_stores" 数组内,取消注释所有值,除了 "Spatie\Health\ResultStores\InMemoryHealthResultStore::class"。
在 config/filesystems.php 中
- 将以下磁盘添加到 "disks" 数组中
env('HEALTH_CHECKS_SCHEDULER_DISK', 'scheduler') => [
'driver' => 'local',
'root' => storage_path('logs/' . env('HEALTH_CHECKS_SCHEDULER_DISK', 'scheduler')),
]
使用
待办事项
测试
待办事项