Refactor Router Logger#17308
Merged
Merged
Conversation
zeripath
reviewed
Oct 14, 2021
44f0fd5 to
20d4018
Compare
zeripath
reviewed
Oct 14, 2021
zeripath
left a comment
Contributor
There was a problem hiding this comment.
I don't completely understand what you're trying to do here but I really dislike the "panic occurred " changes.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
73788b1 to
f3a1f40
Compare
This comment has been minimized.
This comment has been minimized.
f3a1f40 to
81fc293
Compare
This comment has been minimized.
This comment has been minimized.
zeripath
reviewed
Oct 19, 2021
zeripath
reviewed
Oct 19, 2021
zeripath
reviewed
Oct 19, 2021
Signed-off-by: Andrew Thornton <art27@cantab.net>
Contributor
|
I've sent a small PR to do a few changes but I'll need to think a bit more about this. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Now 1.16.0 is out and we're at the start of the v1.17 cycle we can make more radical breaking changes. In which case we can simply remove the logger v1 changes. Signed-off-by: Andrew Thornton <art27@cantab.net>
Remove logger v1
# Conflicts: # modules/web/route.go
Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath
approved these changes
Jan 20, 2022
Contributor
|
Although this is potentially an extremely breaking change - we are making this change right at the start of the 1.17 cycle therefore we have time for people to spot this and complain. If necessary we can implement the changes in wxiaoguang#4 and rediscuss the log levels for started etc. |
Closed
zjjhot
pushed a commit
to zjjhot/gitea
that referenced
this pull request
Jan 21, 2022
* giteaoffical/main: [skip ci] Updated translations via Crowdin Refactor jwt.StandardClaims to RegisteredClaims (go-gitea#18344) format with gofumpt (go-gitea#18184) Enable deprecation error for v1.17.0 (go-gitea#18341) Use correct translation key for errors (go-gitea#18342) Refactor Router Logger (go-gitea#17308) Updated Chroma to v0.10.0 (go-gitea#18270)
Chianina
pushed a commit
to Chianina/gitea
that referenced
this pull request
Mar 28, 2022
Make router logger more friendly, show the related function name/file/line. [BREAKING] This PR substantially changes the logging format of the router logger. If you use this logging for monitoring e.g. fail2ban you will need to update this to match the new format.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background:
The Router logger was very basic and always emitted started and completed logs which were of limited utility. It was difficult from the router log alone to determine which routing function was responsible for creating the response seen.
Further the routing involved reflection at runtime to determine where to route to - this is inefficient and slow, and there was a bug in that the logging level was not previously logged.
This PR
This PR substantially changes the logging format of the router logger. If you use this logging for monitoring e.g. fail2ban you will need to update this to match the new format.
Screenshots
Before
After