[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. |
lyrixx
left a comment
There was a problem hiding this comment.
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 :) |
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.