Stackdriver Error Reporting for Laravel
absszero/laravel-stackdriver-error-reporting is a Laravel package for stackdriver error reporting for laravel.
It currently has 8 GitHub stars and 189.080 downloads on Packagist (latest version v1.9.4).
Install it with composer require absszero/laravel-stackdriver-error-reporting.
Discover more Laravel packages by absszero
or browse all Laravel packages to compare alternatives.
Last updated
Laravel 5.1 ~ 12.x
composer require absszero/laravel-stackdriver-error-reporting
(For PHP7 and before version. please install v1.8.0)
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,
php artisan vendor:publish --provider="Absszero\ErrorReportingServiceProvider"
Get service account credentials
with the role logging.logWriter (docs)
Store the key file in your project directory and refer to it in your .env like this:
GOOGLE_APPLICATION_CREDENTIALS=/My_Authentication.json
For Laravel 11 and after versions. Edit bootstrap/app.php.
->withExceptions(function (Exceptions $exceptions) {
$exceptions->report(function (\Throwable $e) {
(new \Absszero\ErrorReporting)->report($e);
});
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);
}
}
git checkout -b my-new-featuregit commit -am 'Add some feature'git push origin my-new-featureTODO: Write credits
This project is licensed under the MIT License - see the LICENSE file for details