add Requests logger#9
Merged
LbP22 merged 8 commits intodevforth:mainfrom Aug 1, 2023
panz3r:main
Merged
Conversation
Contributor
|
@panz3r looks awesome! @MultiFox200 @LbP22 could you please someone take a look and merge once you have a time? |
MultiFox200
approved these changes
Jul 26, 2023
LbP22
approved these changes
Aug 1, 2023
Contributor
|
Thanks for your work! Your changes released as version 1.0.5! |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a Requests logger handler to the main
http.Handlerthat can be enabled using a newloggeroption.The logger handler implementation is based upon
rs/zerologlogging library and supports printing log events as either JSON or pretty text (enabled via another option:log-pretty).Example JSON log output
{ "level": "info", "method": "GET", "path": "/", "code": 200, "size": 449, "duration": 4.654542, "ipAddress": "127.0.0.1", "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0", "referer": "", "time": "2023-07-06T12:34:56+00:00" }