Skip to content
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

fix: change to debug-logging for logging request headers in ApiClient #17332

Closed
wants to merge 1 commit into from
Closed

fix: change to debug-logging for logging request headers in ApiClient #17332

wants to merge 1 commit into from

Conversation

maxl2287
Copy link

@maxl2287 maxl2287 commented Dec 6, 2023

Switch to debug-logging for logging Request-Headers during ApiClient calls.

Fixes #17331

@@ -834,7 +834,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
private void logRequest(HttpRequest request, byte[] body) throws UnsupportedEncodingException {
log.info("URI: " + request.getURI());
log.info("HTTP Method: " + request.getMethod());
log.info("HTTP Headers: " + headersToString(request.getHeaders()));
log.debug("HTTP Headers: " + headersToString(request.getHeaders()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for your use case, you only want to skip one particular line in the log.

What about using customized templates (e.g. -t via CLI) instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the guidance!
My intention was also to prevent the inclusion of Base64 encoded secrets as "info" in the logs. Shouldn't this solution be applicable to every user, rather than being specific to just my case?

@maxl2287
Copy link
Author

I discovered that this logs only occurre when setting "debug" for APIClient.
I will close this issue.

@maxl2287 maxl2287 closed this Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] [Security] Generated ApiClient is logging "Authorization"-header as "info"
2 participants