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
__WARNING__: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. <i>Authorization</i> headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`.
113
-
114
-
__NOTE__: This is a convenience method that calls `HTTPClient.enableDebugLogging()`. The `SpeakeasyHTTPClient` honors this setting. If you are using a custom HTTP client, it is up to the custom client to honor this setting.
115
-
116
-
Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies.
117
91
<!-- End SDK Installation [installation] -->
118
92
119
93
<!-- Start SDK Example Usage [usage] -->
@@ -1269,6 +1243,37 @@ public class Application {
1269
1243
```
1270
1244
<!-- End Server Selection [server] -->
1271
1245
1246
+
<!-- Start Debugging [debug] -->
1247
+
## Debugging
1248
+
1249
+
### Debug
1250
+
You can setup your SDK to emit debug logs for SDK requests and responses.
1251
+
1252
+
For request and response logging (especially json bodies), call `enableHTTPDebugLogging(boolean)` on the SDK builder like so:
1253
+
```java
1254
+
SDK.builder()
1255
+
.enableHTTPDebugLogging(true)
1256
+
.build();
1257
+
```
1258
+
Example output:
1259
+
```
1260
+
Sending request: http://localhost:35123/bearer#global GET
__WARNING__: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. <i>Authorization</i> headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`.
1271
+
1272
+
__NOTE__: This is a convenience method that calls `HTTPClient.enableDebugLogging()`. The `SpeakeasyHTTPClient` honors this setting. If you are using a custom HTTP client, it is up to the custom client to honor this setting.
1273
+
1274
+
Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies.
1275
+
<!-- End Debugging [debug] -->
1276
+
1272
1277
<!-- Placeholder for Future Speakeasy SDK Sections -->
0 commit comments