m6web / monolog-extra-bundle
Provide extra features for Monolog
Installs: 294 986
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 51
Forks: 2
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=8.1
- monolog/monolog: ^3.0
- symfony/expression-language: ~5.0 || ~6.0
- symfony/framework-bundle: ~5.0 || ~6.0
- symfony/monolog-bundle: ~3.0
Requires (Dev)
- atoum/atoum: ~3.4 || ~4.0
- symfony/yaml: ~5.0 || ~6.0
README
MonologExtraBundle ![Build Status](https://camo.githubusercontent.com/e63007d19de08fa1ae9eccbe32455e8859cb6ff08633ebc2895dbbd6762039bd/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e742e7376673f75726c3d6874747073253341253246253246616374696f6e732d62616467652e6174726f782e646576253246426564726f636b53747265616d696e672532464d6f6e6f6c6f67457874726142756e646c6525324662616467652533467265662533446d6173746572267374796c653d666c6174)
Provide extra features for Monolog.
The actual version of this bundle support Symfony >= 4.4
.
If you need support for older versions, you have to use version < 3.0
.
Installation
Via composer :
"require": {
"m6web/monolog-extra-bundle":"1.1.*"
}
then enable the bundle in your kernel:
<?php
$bundles = [
new M6Web\Bundle\MonologExtraBundle\M6WebMonologExtraBundle
];
Configuration
Processors
A processor can add, modify or remove log content.
For now, only one processor is available: ContextInformationProcessor
. It allows you to add extra context information to each log entry.
m6_web_monolog_extra:
processors:
myProcessor:
# Given that there is only one processor for now,
# type is optionnal and will have ContextInformation as default value
type: ContextInformation
# You can attach the processor to a handler or a channel, but not both
# Those two configuration entry are optionnal, if you omit both
# then the processor will be attached to all log channel and handlers.
handler: gelf
channel: request
# Then you can define the context information you wish to add
# Each entry under config will be an entry in context information
config:
foo: bar
bar: foo
env: expr(container.getParameter('kernel.environment'))
Tests
$ ./vendor/bin/atoum