-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DX] [HttpKernel] Use "context" argument when logging route in RouterListener #12594
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
Conversation
👍 I also had this change on my todo list. IMO should be merged into 2.3 |
👍 @iltar I think it was done this way because those messages were created before the PSR. Moving stuff to the context is indeed a good idea. Can you work on another PR for 2.7? Thanks. |
Thank you @iltar. |
…route in RouterListener (iltar) This PR was merged into the 2.7 branch. Discussion ---------- [DX] [HttpKernel] Use "context" argument when logging route in RouterListener | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT When using the "fingers_crossed" option, I only log stuff when a certain level is reached. I found the matched route with parameters to be extremely useful. The only problem was, that it gets dumped in a string, which reduces readability significantly when having multiple parameters. I've used the context argument to provide the additional information so it becomes easier to read. Especially for formatters that use the context, such as the HtmlFormatter, can really use this. *I've done a quick check and noticed that almost always the information is dumped in the message, while I think it should be in the context. Is this something that should be changed in general?* Commits ------- 448c03f [HttpKernel] RouterListener uses "context" argument when logging route
@fabpot you mean this one for 2.3? This is merged into 2.7. Or were you pointing at the usages of the context? |
@iltar Sorry, I meant doing another PR for other places where we could move parameters to the context instead of embedding them into a string. |
I should be able to make some time next week(s), I'll submit a PR when done. Do you want me to base them off the 2.3 branch? |
@iltar It should be done on 2.7. Thanks. |
…rs (iltar) This PR was squashed before being merged into the 2.7 branch (closes #13418). Discussion ---------- [DX] Attempt to improve logging messages with parameters | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #12594 (comment) | License | MIT | Doc PR | n/a This PR is a follow-up of #12594 `[DX] [HttpKernel] Use "context" argument when logging route in RouterListener`. I have attempted to improve the log messages, as well as updating the usage context. I wasn't sure if the log messages should end with a `.` or not, if so I can update all messages to confirm a standard. Commits ------- ea80c9b [DX] Attempt to improve logging messages with parameters
…rs (iltar) This PR was squashed before being merged into the 2.7 branch (closes #13418). Discussion ---------- [DX] Attempt to improve logging messages with parameters | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#12594 (comment) | License | MIT | Doc PR | n/a This PR is a follow-up of #12594 `[DX] [HttpKernel] Use "context" argument when logging route in RouterListener`. I have attempted to improve the log messages, as well as updating the usage context. I wasn't sure if the log messages should end with a `.` or not, if so I can update all messages to confirm a standard. Commits ------- ea80c9b [DX] Attempt to improve logging messages with parameters
…rs (iltar) This PR was squashed before being merged into the 2.7 branch (closes #13418). Discussion ---------- [DX] Attempt to improve logging messages with parameters | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#12594 (comment) | License | MIT | Doc PR | n/a This PR is a follow-up of #12594 `[DX] [HttpKernel] Use "context" argument when logging route in RouterListener`. I have attempted to improve the log messages, as well as updating the usage context. I wasn't sure if the log messages should end with a `.` or not, if so I can update all messages to confirm a standard. Commits ------- ea80c9b [DX] Attempt to improve logging messages with parameters
When using the "fingers_crossed" option, I only log stuff when a certain level is reached. I found the matched route with parameters to be extremely useful. The only problem was, that it gets dumped in a string, which reduces readability significantly when having multiple parameters.
I've used the context argument to provide the additional information so it becomes easier to read. Especially for formatters that use the context, such as the HtmlFormatter, can really use this.
I've done a quick check and noticed that almost always the information is dumped in the message, while I think it should be in the context. Is this something that should be changed in general?