LaravelPackages.net
Acme Inc.
Toggle sidebar
deferdie/laravel-stackdriver

An exception logger for Laravel to log to Google Stackdriver

14.152
5
v0.0.7
About deferdie/laravel-stackdriver

deferdie/laravel-stackdriver is a Laravel package for an exception logger for laravel to log to google stackdriver. It currently has 5 GitHub stars and 14.152 downloads on Packagist (latest version v0.0.7). Install it with composer require deferdie/laravel-stackdriver. Discover more Laravel packages by deferdie or browse all Laravel packages to compare alternatives.

Last updated

Laravel Stackdriver

Installation:

composer require deferdie/laravel-stackdriver

Add the following enviroment variables to your .env file

GCP_PROJECT_ID=YOUR GOOGLE CLOUD PROJECT ID
GCP_LOG_NAME=YOUR LOG NAME <YOUR LARAVEL PROJECT NAME>
GOOGLE_APPLICATION_CREDENTIALS=PATH TO YOUR CREDIENTIAL.JSON FILE

To optain a JSON file containing your credientials, you first need to create a google service account and get a key file from the IAM section.

In your config/app.php within your providers array

StackDriverLogger\LaravelStackDriverServiceProvider::class,

In your app/Exceptions/Handler.php

use StackDriverLogger\StackDriverLogger;

and finally within the report function

$log = new StackDriverLogger();
$log->log($exception);
Comments