-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Improve endpoint mapping debug logging #14292
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
Comments
The output comes from |
I think it's by design, as you get that sort of output for Spring MVC Controllers:
See #13511 |
Indeed this is by design. The output in Brian's comment shows the intended DEBUG level information per HTTP request. Perhaps the output in the first comment looks odd because it lacks the rest of the |
Thanks, both. I hadn't appreciated that the handler would typically be the user's controller. This, then, is an unfortunate side-effect of all the endpoint operations being handled by the same handler that then does some further routing to call the appropriate method for the operation. |
So there is an extra log message missing with the actuator routing details. In full context (i.e. including o.s.web), you would see a) the request info, b) the Spring MVC mapping, and c) the actuator routing, which I think is fine even if b) in this case isn't very helpful. Optionally AbstractHandlerMapping could log b) from a protected method, so it can be suppress it altogether. |
We might be able to override |
I've marked this as a bug because I think we really need to improve it in some way before GA |
It should be noted that the code above is without devtools and therefore the logging tuning that are applied now. If I add devtools, this is the current log:
|
It's curious that this line is logged twice:
Any idea why that happens? I'm also not sure how useful it is that the entire response body is logged. It's a bit overwhelming in this case and I imagine that it will be in others where the body isn't small. |
For the body it's relying on the |
Thanks, Rossen. Is there an SPR issue for that, or should we open one? |
Yes please, create one. |
I've opened https://jira.spring.io/browse/SPR-17254. |
Now that SPR-17254 is resolved, I've tried to improve the logging experience for Actuator web endpoints; basically turning this into something more useful, because currently it's writing the same information for all endpoints:
I've locally patched
The interesting bit is A couple of solutions here:
|
I have an app that exports metrics to Prometheus with
--debug
. Prometheus calls/actuator/prometheus
every 5 sec which leads to the followingTo complement with recent improvements in logging, I think we should attempt to improve this log if we can.
The text was updated successfully, but these errors were encountered: