Skip to content

woganmay/MonologStackdriverHandler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build status Coverage Status

MonologStackdriverHandler

Monolog Stackdriver Handler is Stackdriver handler for Monolog. It will send Stackdriver a log when an app logs something.
To use this handler, you should have Google Project Id. For more details, check here

Installation

You can install the latest version with:

$ composer require asiagohan/monolog-stackdriver-handler

When use it with Laravel5

edit bootstrap/app.php as below:

$app->configureMonologUsing(function ($monolog) {
     $stackdriverHandler = new MonologStackdriverHandler\MonologStackdriverHandler('googleProjectId');
     $monolog->pushHandler($stackdriverHandler);
});

If you want to change the name of the log or other options,

$app->configureMonologUsing(function ($monolog) {
    $stackdriverHandler = new MonologStackdriverHandler\MonologStackdriverHandler(
       'googleProjectId',
       'logName',
       [
           'resource' => [
               'labels' => [
                   'foo' => 'bar',
               ],
           ],
       ]
    );
     $monolog->pushHandler($stackdriverHandler);
});

About

Stackdriver Handler for Monolog

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages