-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[MonologBridge] Add monolog processors adding route and command info #28330
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
[MonologBridge] Add monolog processors adding route and command info #28330
Conversation
27f07bc
to
62ee940
Compare
I like it but I have some comments
|
The last one is the current one. It pops last entry during "kernel.finish_request". What do you think?
@lyrixx What do you think? |
e6dee3f
to
803dc25
Compare
@lyrixx Can you review the latest version of this PR? Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems better. 👏
I left some comments.
Thanks for your work.
src/Symfony/Bridge/Monolog/Tests/Processor/ConsoleCommandProcessorTest.php
Outdated
Show resolved
Hide resolved
329933c
to
228511e
Compare
Thanks for your feedback @lyrixx . I've updated the changes. In RouteProcessor I've decided to use |
meanwhile, ProcessorInterface has been removed from the bridge and added to Monolog directly in Seldaek/monolog#1204 |
Would you like me to create PR in symfony/monolog-bundle registering this classes, or should I wait till some decision is made? |
Let's first finish this one :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except one tiny comment
ac92e84
to
d331569
Compare
@lyrixx thanks, I've made the change. I've also removed extending ProcessorInterface, since it's no longer there. It should be ready now. |
let's merge this one (except for native English, I can not tell) |
e17ae9a
to
669f6b2
Compare
Thank you @trakos. |
…d command info (trakos) This PR was squashed before being merged into the 4.3-dev branch (closes #28330). Discussion ---------- [MonologBridge] Add monolog processors adding route and command info | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#10244 This PR adds two simple processors that add context to every log entry. RouteProcessor adds routing information: `app.INFO: Some log text {"someContext":"ctx"} {"route":{"controller":"App\\Controller\\SomeController::number","route":"index","route_params":[]}` ConsoleCommandProcessors adds current command information: `app.INFO: Some log text {"someContext":"ctx"} {"command":{"name":"app:some-command","arguments":{"command":"app:some-command","some-argument":10}}}` For ConsoleCommandProcessor I've decided against including command options by default, because there's a lot of default ones: `"options":{"help":false,"quiet":false,"verbose":false,"version":false,"ansi":false,"no-ansi":false,"no-interaction":false,"env":"dev","no-debug":false}`. This behavior can be changed with a constructor argument. Commits ------- 669f6b2 [MonologBridge] Add monolog processors adding route and command info
This PR was merged into the master branch. Discussion ---------- Add documentation on new monolog processors Documentation supporting symfony/symfony#28330 Commits ------- 3421c6c [MonologBridge] Add documentation on new processors
This PR adds two simple processors that add context to every log entry.
RouteProcessor adds routing information:
app.INFO: Some log text {"someContext":"ctx"} {"route":{"controller":"App\\Controller\\SomeController::number","route":"index","route_params":[]}
ConsoleCommandProcessors adds current command information:
app.INFO: Some log text {"someContext":"ctx"} {"command":{"name":"app:some-command","arguments":{"command":"app:some-command","some-argument":10}}}
For ConsoleCommandProcessor I've decided against including command options by default, because there's a lot of default ones:
"options":{"help":false,"quiet":false,"verbose":false,"version":false,"ansi":false,"no-ansi":false,"no-interaction":false,"env":"dev","no-debug":false}
. This behavior can be changed with a constructor argument.