IBM / java-sdk-core

Core functionality required by Java code generated by the IBM Cloud OpenAPI SDK Generator (openapi-sdkgen)
https://ibm.github.io/java-sdk-core/
Apache License 2.0
20 stars 21 forks source link

fix(logging): improve java core's debug logging #226

Closed padamstx closed 2 weeks ago

padamstx commented 1 month ago

This commit adds some debug logging in various components, and also modifies some tests so that it's easy to enable debug logging when running individual sets of tests.

padamstx commented 2 weeks ago

Temporarily changed this PR to draft status while I'm working on adding the redact secrets function and simplifying the testcase changes I original made in this PR.

padamstx commented 2 weeks ago

@dpopp07 @pyrooka, I've updated the PR to include a new logging interceptor (HttpLogger) which mimics the behavior of the okhttp3 HttpLoggingInterceptor class, except that it redacts secrets within the debug messages that it logs.

I've also made it easier to enable debug logging... The easiest way to do this while running tests is like this (in case you wanted to try it out):

cd <project-root>
mvn test -Dtest=<testclassname> -Djava.util.logging.config.file=debug-logging.properties

e.g.
mvn test -Dtest=ContainerAuthenticatorTest -Djava.util.logging.config.file=debug-logging.properties

(I added debug-logging.properties to the project in this PR).

ibm-devx-sdk commented 2 weeks ago

:tada: This PR is included in version 9.21.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: