-
Notifications
You must be signed in to change notification settings - Fork 6
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
Request logging #597
Request logging #597
Conversation
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.
The changes look good to me, but there's a conflict that needs to be resolved first.
…other projects, such as Wiser.
…lways return an ID.
9f4cbc0
to
3bb124c
Compare
Merge conflict solved. |
} | ||
if (String.IsNullOrWhiteSpace(result)) | ||
{ | ||
result = GetHeaderValueAs<string>(httpContext, "X_FORWARDED_FOR"); // TransIP and other providers use this. |
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.
It looks like the indentation here got a bit messed up after the rebase. Can you fix this?
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.
Sorry, didn't notice this. Is fixed now.
Describe your changes
Added middleware to log all requests. This will log everything from the request and the response, but some sensitive information will be redacted in the logs. This is turned off by default and needs to be turned on if you want to use it in a project. If enabled, a new table
gcl_request_log
will be automatically created, the logs will be stored there.The middleware is made so that you can overwrite it in other projects to customize the logs. This will be used in Wiser to log requests that are done via it's API.
Type of change
Please check only ONE option.
How was this tested?
I have tested this by opening a test website and doing some requests and checking if my requests are being logged correctly. I have also tested this in the Wiser API to see if requests are logged correctly there too, after making customizations that are needed for Wiser. Wiser pull request will come later.
Checklist before requesting a review
develop
as the base branch and notmain
, or the pull request is a hotfix that needs to be done directly onmain
Related pull requests
N/A
Link to Asana ticket
https://app.asana.com/0/1205090868730163/1205939790117085