Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MonologBundle processor per handler #77

Closed
flip111 opened this issue Apr 14, 2014 · 4 comments
Closed

MonologBundle processor per handler #77

flip111 opened this issue Apr 14, 2014 · 4 comments

Comments

@flip111
Copy link

flip111 commented Apr 14, 2014

Problem description:
The configuration option for processors per handler is not available.

Docs: http://symfony.com/doc/current/cookbook/logging/monolog.html#adding-a-session-request-token

If you use several handlers, you can also register the processor at the handler level instead of globally.

Example: https://github.com/symfony/MonologBundle/blob/master/DependencyInjection/Configuration.php#L562

Error:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized options "processors" under "monolog.handlers.main"

Config:

monolog:
    handlers:
        main:
            type:  stream
            path:  %kernel.logs_dir%/%kernel.environment%.log
            level: debug
            processors: [@monolog.processor.log]

Notice that no actual configuration option for "processors" can be found in the DI configuration.

Note: this is a copy of symfony/symfony#10704

@stof
Copy link
Member

stof commented Apr 14, 2014

This is outdated doc. Processors are registered by tagging them as monolog.processor, not by giving their id in the config

@xabbuh
Copy link
Member

xabbuh commented Apr 14, 2014

I hope I described the issue properly: symfony/symfony-docs#3798

@flip111
Copy link
Author

flip111 commented Apr 14, 2014

@stof how can the processor be registered now to a specific handler? And maybe also nice to know: how can they be registered globally?

Also note that it's not just the symfony documentation by also the MonologBundle gives a wrong example.

@stof
Copy link
Member

stof commented Apr 14, 2014

the tag can has either a handler attribute to register it for a specific handler only, or a channel attribute for a specific channel

@stof stof closed this as completed in 8aad6d7 Apr 14, 2014
weaverryan added a commit to symfony/symfony-docs that referenced this issue Jul 1, 2014
This PR was submitted for the 2.5 branch but it was merged into the 2.3 branch instead (closes #3979).

Discussion
----------

removed invalid processors option

As per symfony/monolog-bundle#77

Commits
-------

a462258 removed invalid processors option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants