absszero/laravel-stackdriver-error-reporting 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

absszero/laravel-stackdriver-error-reporting

最新稳定版本:v1.9.1

Composer 安装命令:

composer require absszero/laravel-stackdriver-error-reporting

包简介

Stackdriver Error Reporting for Laravel

README 文档

README

actions/workflows/run-tests.yaml

Requirements

Laravel 5.1 ~ 12.x

Installation

  1. composer require absszero/laravel-stackdriver-error-reporting

    (For PHP7 and before version. please install v1.8.0)

  2. This package provides Package Auto-Discovery.

    For Laravel versions before 5.5, you need to add the ServiceProvider in config/app.php

    <?php
    ...
    'providers' => [
        Absszero\ErrorReportingServiceProvider::class,
  3. php artisan vendor:publish --provider="Absszero\ErrorReportingServiceProvider"

Configuration

  1. Get service account credentials with the role logging.logWriter (docs)

  2. Store the key file in your project directory and refer to it in your .env like this:

    GOOGLE_APPLICATION_CREDENTIALS=/My_Authentication.json
    
  3. For Laravel 11 and after versions. Edit bootstrap/app.php.

        ->withExceptions(function (Exceptions $exceptions) {
            $exceptions->report(function (\Throwable $e) {
                (new \Absszero\ErrorReporting)->report($e);
            });
  4. For Laravel 10 and before versions. Edit app/Exceptions/Handler.php.

    For Laravel 9 and after versions.

    <?php
        public function register()
        {
            $this->reportable(function (Throwable $e) {
                (new \Absszero\ErrorReporting)->report($e);
            });
        }

    For PHP version before 7, replace \Throwable with \Exception.

    <?php
        public function report(\Throwable $exception)
        {
            parent::report($exception);
            if ($this->shouldReport($exception)) {
                (new \Absszero\ErrorReporting)->report($exception);
            }
        }

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Credits

TODO: Write credits

License

This project is licensed under the MIT License - see the LICENSE file for details

统计信息

  • 总下载量: 165.75k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-01