nmc/laravel-cloud-logging
最新稳定版本:1.3.2
Composer 安装命令:
composer require nmc/laravel-cloud-logging
包简介
Google Cloud Logging For Laravel
README 文档
README
Installation
You can install the package via composer:
composer require nmc/laravel-cloud-logging
You can publish the config file with:
php artisan vendor:publish --provider="Nmc\CloudLogging\CloudLoggingServiceProvider" --tag="cloud-logging-config"
This is the contents of the published config file:
return [ 'enable_error_reporting' => env('CLOUD_LOGGING_ENABLE_ERROR_REPORTING', isset($_SERVER['GAE_SERVICE']) ?? false), 'logger' => [ 'driver' => 'stackdriver', 'level' => env('LOG_LEVEL', 'debug'), 'name' => env('CLOUD_LOGGING_NAME', 'laravel-cloud-logging'), 'project' => env('CLOUD_LOGGING_PROJECT_ID'), 'credentials' => env('CLOUD_LOGGING_CREDENTIALS', config_path('stackdriver.json')), ], ];
Edit app/Exceptions/Handler.php
use Nmc\CloudLogging\CloudErrorReporting; public function register(): void { $this->reportable(function (Throwable $e) { if (CloudErrorReporting::isEnabled()) { CloudErrorReporting::report($e); } }); }
Usage
use Illuminate\Support\Facades\Log; Log::channel('stackdriver')->info('Test');
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 4.54k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-28