Closed kingcrunch closed 5 years ago
:+1:
Edit : appears to be french translation error, in english doc there is no section processors
In the http://symfony.com/fr/doc/current/reference/configuration/monolog.html you have :
# Exemples: syslog: type: stream path: /var/log/symfony.log level: ERROR bubble: false formatter: my_formatter processors: - some_callable
With processors, but :
Unrecognized options "processors" under "monolog.handlers.syslog" when I try to use it, and after a quick search no trace of "processors" in https://github.com/symfony/MonologBundle/blob/master/DependencyInjection/Configuration.php
It took me a while to find that the current solution to make monolog PSR-3 compatible was to add:
monolog.processor.psr_log_message_processor:
class: Monolog\Processor\PsrLogMessageProcessor
tags:
- { name: monolog.processor }
But this feels too complicated to me, so :+1: for this issue (or for making the PsrLogMessageProcessor
a default processor).
With Symfony 3.4+ with autoconfiguration, and #285, processors added to an application will be automatically registred. So Now it's really super easy to add a processor to monolog. That's why I'm closing this issue.
Monolog and the Monolog-bridge come with some pre-defined processors to use. It would be nice, if one could enable them easily via configuration, like