Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 878 Bytes

laravel_laravel_v5_7.md

File metadata and controls

33 lines (25 loc) · 878 Bytes

Laravel/Laravel v5.7

config/logging.php

Add the following entry to the channels section in the array below the existing entries.

'channels' => [

    // ( ... )

    'stackdriver' => [
        'driver' => 'custom',
        'via' => CodeInternetApplications\MonologStackdriver\Laravel\CreateStackdriverLogger::class,
        'logName' => 'my-project-log',
        // 'loggingClientOptions' => [
        //     'keyFilePath' => '/path/to/service-account-key-file.json',
        // ],
        // 'loggerOptions' => [],
        // 'lineFormat' => '%message%',
        // 'entryOptionsWrapper' => 'stackdriver',
    ],
]

.env

Edit .env to update LOG_CHANNEL to stackdriver. And finally add GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PROJECT or use loggingClientOptions to set path to key file and project id.

LOG_CHANNEL=stackdriver