-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[dotnet] Log http requests/responses via internal DiagnosticsHttpHandler #13978
[dotnet] Log http requests/responses via internal DiagnosticsHttpHandler #13978
Conversation
PR Description updated to latest commit (a6c82f6)
|
PR Review 🔍
|
PR Code Suggestions ✨
|
@SeleniumHQ/selenium-committers should we include http request/response body of internal wire protocol to internal logs? |
Hi @nvborisenko I'll wait for everyone's opinion on whether we should include HTTP request/response bodies in internal logs. Let's gather everyone's thoughts about this then later on we can decide whether to include it or not. Thanks for looking up |
Hey! Thank you for your contribution. However, a typical concern with logging HTTP responses is the body size. For example, the response size might be huge when fetching the web page source. It might be a good idea to log the HTTP response body if the status code is not 2xx. Basically, logging in detail on error situations only. |
That's a great valid point. I will take it into consideration and update the PR accordingly. Thanks @pujagani |
….com/ChrstnAnsl/selenium into dotnet-fix-no-such-execution-context
Hi @pujagani updated the PR. Please see the changes. Thank you! |
LGTM. Thank you! @nvborisenko is the C# expert. Please help review it further. |
….com/ChrstnAnsl/selenium into dotnet-fix-no-such-execution-context
@nvborisenko Fix and consider all the suggestions and comments. Please see the latest commit |
@ChrstnAnsl this is exactly what we wanted to see and can accept, thank you! Please just fix minor issues. BTW do you want to improve the logic here little bit? Now in logs we will see 2 log entries for http request: the first one is like
where |
Hi @nvborisenko adjusted the logic and fix the last minor comment. Please see the latest commit. Thank you |
Let me help here slightly, I am going to push new commits if you don't mind. |
Sure, go ahead! Thanks |
I am done, could you please review? |
Hi @nvborisenko LGTM! |
In logs we see:
Looks good to me. |
…ler (SeleniumHQ#13978) * [dotnet] Add Execution Context * Added http status code validation * update validation http status code validation as int * Update http validation status code from 299 to 399 * Logs Response to HttpClientHandler * update name * revert http response message logger * Remove White Space * fix build error * Update InterceptAsync Summary * Update Logger field initialization * Remove logger parameter in ResponseLoggerInterceptor method * fix comment to add responseBody inside the if statement * Update Delegating Handler and Remove unable to push files in local * Update from null validation to status code * Fix comment * fix minor comments and adjust logic improvement * Revert "fix minor comments and adjust logic improvement" This reverts commit 4240536. * Null check for response content * Requests/Responses as single log message * Pass logger from upstream * Fix missing responses in log * Put log message in parallel with sending a request --------- Co-authored-by: Nikolay Borisenko <[email protected]>
User description
Description
Added Context to support and fix BUG #13920
Motivation and Context
I have encountered the same issue and wanting to debug it more but unfortunately there's not enough error logs to let me debug it
Types of changes
Checklist
PR Type
Bug fix, Enhancement
Description
HttpCommandExecutor
.Changes walkthrough 📝
HttpCommandExecutor.cs
Add detailed logging for HTTP request and response bodies
dotnet/src/webdriver/Remote/HttpCommandExecutor.cs