-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Refactor Router Logger #17308
Refactor Router Logger #17308
Conversation
44f0fd5
to
20d4018
Compare
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.
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.
Signed-off-by: Andrew Thornton <[email protected]>
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 <[email protected]>
Remove logger v1
# Conflicts: # modules/web/route.go
Signed-off-by: Andrew Thornton <[email protected]>
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. |
* 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)
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.
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