Skip to content

Handler formatter example was using wrong defined service #9000

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

Closed
wants to merge 1 commit into from

Conversation

gregsomers
Copy link
Contributor

The service class passed to the formatter in the example handler was using the processor service instead of the formatter service. It should instead use monolog.formatter.session_request, otherwise monolog complains that the class does not implement interface Monolog\Formatter\FormatterInterface.

@javiereguiluz
Copy link
Member

This looks OK ... but Monolog was always too confusing to me, so I'll wait for other reviews before merging. Also, if this is the correct change, we should update the XML and PHP config below too. Thanks!

@@ -71,7 +71,7 @@ using a processor.
type: stream
path: '%kernel.logs_dir%/%kernel.environment%.log'
level: debug
formatter: app.logger.session_request_processor
formatter: monolog.formatter.session_request
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks correct to me. Can you also update the other configuration formats? They seem to have the same incorrect value at the formatter option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iltar no problem, I've updated the other configuration formats

The service class passed to the formatter in the example handler was using the processor service instead of the formatter service. It should instead use `monolog.formatter.session_request`, otherwise monolog complains that the class does not implement interface `Monolog\Formatter\FormatterInterface`.
@javiereguiluz
Copy link
Member

@gregsomers thanks for fixing this! We've merged it on 2.7 branch, which is the oldest maintained branch that contains the bug and we'll "merge it up" on the other branches. GitHub may make it look as closed instead of merged ... but it's merged. Thanks!

javiereguiluz added a commit that referenced this pull request Jan 29, 2018
… (gregsomers)

This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #9000).

Discussion
----------

Handler formatter example was using wrong defined service

The service class passed to the formatter in the example handler was using the processor service instead of the formatter service. It should instead use `monolog.formatter.session_request`, otherwise monolog complains that the class does not implement interface `Monolog\Formatter\FormatterInterface`.

Commits
-------

447844a Handler formatter example was using wrong defined service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants