firevel/stackdriver-log-channel

Laravel Stackdriver log channel for Google App Engine

1.0.0 2019-05-05 02:53 UTC

This package is auto-updated.

Last update: 2021-12-26 20:29:49 UTC


README

Stackdriver log channel for Laravel and Firevel compatible with Google App Engine standard environment (PHP 7.2).

Installation

  1. Install package with composer require firevel/stackdriver-log-channel

  2. Add to config/logging.php:

        'stackdriver' => [
            'driver' => 'custom',
            'via' => Firevel\Stackdriver\CreateStackdriverLogger::class,
            'level' => 'debug',
        ],
  1. Replace report method in App\Exceptions\Handler with:
    /**
     * Google Cloud Stackdriver Error Reporting.
     *
     * @param  \Exception  $exception
     * @return void
     */
    public function report(Exception $exception)
    {
        if (env('GAE_SERVICE')) {
            \Firevel\Stackdriver\StackdriverExceptionHandler::handle($exception);
        } else {
            parent::report($exception);
        }
    }
  1. Update your app.yaml with:
env_variables:
  LOG_CHANNEL: stackdriver