You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit adds some debug logging in various
components and adds a custom interceptor that performs
http message logging while redacting secrets in the debug messages.
Signed-off-by: Phil Adams <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+42
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,48 @@ The java-sdk-core project supports the following types of authentication:
47
47
48
48
For more information about the various authentication types and how to use them with your services, click [here](Authentication.md).
49
49
50
+
## Logging
51
+
This project uses the [java.util.logging](https://docs.oracle.com/en/java/javase/11/core/java-logging-overview.html)
52
+
framework for logging errors, warnings, informational and debug messages. The output is controlled by configuring the desired
53
+
logging level (SEVERE, WARNING, INFO, FINE, etc.) for various loggers.
54
+
55
+
Each class within the project creates its own logger which is named after the class (e.g. `com.ibm.cloud.sdk.core.service.BaseService`).
56
+
The logger names form a hierarchy that mirrors the package/class hierarchy. A logging level can be configured for an individual logger
57
+
or for a group of loggers by leveraging the package name hierarchy.
58
+
59
+
You can configure the logging framework programmatically by using the [java.util.logging API](https://docs.oracle.com/javase/8/docs/api/java/util/logging/package-summary.html) to create and configure
60
+
loggers, handlers and formatters. Please consult the logging framework documentation for more details on this.
61
+
62
+
You can also configure the framework by defining the desired configuration in a file, then
63
+
supplying the name of the file to the logging framework when you run your application.
64
+
Included with this project are two files which serve as examples of how to configure the logging framework:
65
+
*`logging.properties`: this file contains the default configuration which will display messages that are logged at
66
+
level INFO and above (e.g. INFO, WARNING, SEVERE) on the console
67
+
*`debug-logging.properties`: this file contains a sample configuration that will set the logging level to FINE for all
68
+
Java SDK core loggers and INFO for all other loggers
69
+
70
+
To cause the logging framework to use a particular configuration file when running your java application, specify the
71
+
name of the configuration file with the `java.util.logging.config.file` system property, like this:
0 commit comments