chaplean/monolog-extra-bundle
This bundle adds support for extra fields for symfony/monolog-bundle (>= 3.0).
This bundle requires at least Symfony 3.0.
You can use composer to install monolog-extra-bundle:
composer require chaplean/monolog-extra-bundle
Then add to your AppKernel.php:
new Chaplean\Bundle\MonologExtraBundle\ChapleanMonologExtraBundle(),
Optionally if you want to add global extra fields.
services.yml:
services:
your_service_name:
class: Chaplean\Bundle\MonologExtraBundle\Processor\ExtraFieldsProcessor
arguments:
$globalExtraFields:
key : 'value'
key2 : 'value2'
tags:
- { name: monolog.processor, handler: your_handler }
If you want to use logger and send extra field, you can use LoggerExtra which exposes same function than default logger. Add a key 'extra' in the context containing the list of additional fields.
$loggerExtra->error('message', ['extra' => ['key' => 'value']])
monolog-extra-bundle follows semantic versioning. In short the scheme is MAJOR.MINOR.PATCH where
Versions bellow 1.0.0 are considered experimental and breaking changes may occur at any time.
Contributions are welcomed! There are many ways to contribute, and we appreciate all of them. Here are some of the major ones:
master branch.As a reminder, all contributors are expected to follow our Code of Conduct.
You might find the following commands usefull when hacking on this project:
# Install dependencies
composer install
# Run tests
bin/phpunit
monolog-extra-bundle is distributed under the terms of the MIT license.
See LICENSE for details.
How can I help you explore Laravel packages today?