承接 nmc/laravel-cloud-logging 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nmc/laravel-cloud-logging

最新稳定版本:1.3.2

Composer 安装命令:

composer require nmc/laravel-cloud-logging

包简介

Google Cloud Logging For Laravel

README 文档

README

Latest Version on Packagist Total Downloads

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-28