-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client-go/rest: contextual logging of request/response
Logging in rest.Request.Body cannot be made context-aware without an API change. Such a change is complicated if done in a backwards-compatible fashion (must change lots of callers in Kubernetes) and prohibitive if not (all callers of Body would have to pass a context). Instead, logging of the request body gets moved into the functions which send the request. This is a change of behavior, but it is limited to log levels >= 8 and thus should have no impact in production. A request which gets sent multiple times will also log the body multiple times. This might even be a good thing because it serves as reminder what is being sent when it is being sent. While at it, stack backtracing gets enhanced so that the caller of the REST API is logged and tests for the new behavior get added. Kubernetes-commit: 57f9b7c7a2412865e7817dbf7638881b00ac9721
- Loading branch information
1 parent
c5e16f8
commit 3d02d42
Showing
2 changed files
with
129 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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