Download the PHP package codeinternetapplications/monolog-stackdriver without Composer
On this page you can find all versions of the php package codeinternetapplications/monolog-stackdriver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codeinternetapplications/monolog-stackdriver
More information about codeinternetapplications/monolog-stackdriver
Files in codeinternetapplications/monolog-stackdriver
Package monolog-stackdriver
Short Description Stackdriver handler for Monolog.
License MIT
Homepage http://github.com/codeinternetapplications/monolog-stackdriver
Informations about the package monolog-stackdriver
MonologStackdriver
This package enables you to push your Monolog log entries to Stackdriver which is part of the Google Cloud Platform.
The supplied StackdriverHandler
copies the given log level into the Stackdriver's severity based on your log method.
It also respects the context argument which allows you to send extra contextual data with your log message. This will be stored in the log message under jsonPayload.data
.
Configuration
Service account
With our samples we assume you have a service account Google Developers Console JSON key file available within your project to point at with read rights.
If you don't have this file yet, you can create it via Google Cloud Platform - IAM & Admin - Service accounts. Please make sure you have at least the role of Logs writer
enabled.
Google\Cloud\Logging\LoggingClient options
Please read the documentation for the Google\Cloud\Logging\LoggingClient for other authentication options and further specific connection and setup.
Google\Cloud\Logging\Logger options
Please read the documentation for the Google\Cloud\Logging\Logger setup via Google\Cloud\Logging\LoggingClient for specific details about these options.
This set of options will allow you to set the default resource type and it's related labels that apply to all the logs. Please read Method: monitoredResourceDescriptors.list and do the "Try this API" to get a full list of the specific labels per resource.
Google\Cloud\Logging\Entry options
Please read the documentation for the Google\Cloud\Logging\Entry setup via Google\Cloud\Logging\Logger for specific details about these options.
By default, you can add Stackdriver specific log entry options by adding these wrapped in the stackdriver
-key inside the context array. Very useful to add log entry specific labels for instance.
If you need to, you can override this key name by setting $entryOptionsWrapper
to your own value (string) when using StackdriverHandler::__construct
.
It is also possible to set path to credentials and project id via the global constant.
Pick your framework for some specific setup
- Laravel/Laravel v5.5
- Laravel/Laravel v5.6
- Laravel/Laravel v5.7
- Laravel/Lumen v5.5
- Laravel/Lumen v5.6
- Laravel/Lumen v5.7