-
Notifications
You must be signed in to change notification settings - Fork 264
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
Missing Logging for Sent Requests During ReadTimeoutException in WebClient #1876
Comments
+1 |
I am seeing the same problem when a read timeout occurs, the request is not logged. I am using SpringRest client. |
I've merged a PR (#2000) that should address this. It'll be part of the next version. |
Hi @kasmarian, this fix seems only for WebClient. What about spring RestClient? |
RestClient may use different http clients that use different Logbook request/response interceptor implementations. Most of them would log the request immediately and not wait for the response. Which one do you use? |
The underlying http client that I am using is the jdk |
Help me reproduce it. I'm getting 3 logs: 1) remote request, 2) local request, 3) local response
|
Yes I am using
So if I remove these properties, the request that times out is being logged. Do you know whether I can still use this strategy but at the same time to log also timeout requests? |
StatusAtLeastStrategy is pretty simple. You can implement your custom strategy to e.g. always log requests. |
Description
When sending requests via WebClient, if the request is successfully sent but a
ReadTimeoutException
occurs, the event of the request being sent is not logged. Additionally, the logging of the request occurs when the response is returned, rather than at the moment the request is made.Expected Behavior
The request should be logged at the moment it is sent, regardless of whether a
ReadTimeoutException
occurs.Actual Behavior
Currently, if a
ReadTimeoutException
is thrown, there is no log entry indicating that the request was sent. Logging occurs only when the response is received, which might never happen if a timeout occurs.Possible Fix
Log the request immediately when the function is called, not after the response is returned.
Steps to Reproduce
ReadTimeoutException
.Context
This bug affects the ability to track and debug issues related to outgoing requests, particularly when responses are delayed or result in timeouts.
Your Environment
Draft decision
Maybe you should add
doOnError
The text was updated successfully, but these errors were encountered: