Skip to content

kohlerdominik/laravel-stackdriver-error-reporting

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stackdriver Error Reporting for Laravel

Build Status

Requirements

Laravel 5.1 ~ 9.x

Installation

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

  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. Edit app/Exceptions/Handler.php. 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

About

Stackdriver Error Reporting for Laravel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%