lhduc/laravel-gcp-logging
Composer 安装命令:
composer require lhduc/laravel-gcp-logging
包简介
Reusable Google Cloud Logging integration for Laravel applications.
README 文档
README
Reusable package that wires a Google Cloud Logging channel into Laravel, adds correlation IDs, and captures HTTP client, queue, and request telemetry.
Installation
composer require lhduc/laravel-gcp-logging
Publish configuration
php artisan vendor:publish --provider="Lhduc\LaravelGcpLogging\Providers\GoogleLoggingServiceProvider" --tag=config
Configure config/google-logging.php or the matching environment variables (GOOGLE_PROJECT_ID, GOOGLE_APPLICATION_CREDENTIALS, GOOGLE_APPLICATION_NAME).
Enable channel
Update config/logging.php:
'channels' => [ // ... 'google' => [ 'driver' => 'custom', 'via' => Lhduc\LaravelGcpLogging\Logging\GoogleLogger::class, 'level' => env('LOG_LEVEL', 'debug'), 'project_id' => env('GOOGLE_APPLICATION_PROJECT'), 'key_file_path' => env('GOOGLE_APPLICATION_CREDENTIALS'), 'log_name' => env('GOOGLE_APPLICATION_NAME', 'application'), 'excluded_routes' => [ 'api/health-check', ], ], ],
Requests hitting the api middleware group automatically receive the correlation middleware. Queue jobs and outbound HTTP client calls will include the correlation identifier and emit structured entries in Google Cloud Logging.
统计信息
- 总下载量: 1.3k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-14