Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ public void buildWithCustomVertx() throws Exception {

CountDownLatch latch = new CountDownLatch(1);
vertx.close(event -> latch.countDown());
assertTrue(latch.await(5, TimeUnit.SECONDS));
// Wait 60 seconds, same as production code.
assertTrue(latch.await(60, TimeUnit.SECONDS));
}
}

Expand Down
32 changes: 30 additions & 2 deletions sdk/core/azure-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,35 @@ or checkout [StackOverflow for Azure Java SDK](https://stackoverflow.com/questio

Azure SDKs for Java provide a consistent logging story to help aid in troubleshooting application errors and expedite
their resolution. The logs produced will capture the flow of an application before reaching the terminal state to help
locate the root issue. View the [logging][logging] wiki for guidance about enabling logging.
locate the root issue. View the [logging][logging] documentation for guidance about enabling logging.

#### HTTP Request and Response Logging

HTTP request and response logging can be enabled by setting `HttpLogDetailLevel` in the `HttpLogOptions` used to create
an HTTP-based service client or by setting the environment variable or system property `AZURE_HTTP_LOG_DETAIL_LEVEL`.
The following table displays the valid options for `AZURE_HTTP_LOG_DETAIL_LEVEL` and the `HttpLogDetailLevel` it
correlates to (valid options are case-insensitive):

| `AZURE_HTTP_LOG_DETAIL_LEVEL` value | `HttpLogDetailLevel` enum |
| ----------------------------------- | ------------------------- |
| `basic` | `HttpLogDetailLevel.BASIC` |
| `headers` | `HttpLogDetailLevel.HEADERS` |
| `body` | `HttpLogDetailLevel.BODY` |
| `body_and_headers` | `HttpLogDetailLevel.BODY_AND_HEADERS` |
| `bodyandheaders` | `HttpLogDetailLevel.BODY_AND_HEADERS` |

All other values, or unsupported values, result in `HttpLogDetailLevel.NONE`, or disabled HTTP request and response
logging. Logging [must be enabled](#enabling-logging) to log HTTP requests and responses. Logging of HTTP headers requires `verbose`
logging to be enabled. The following table explains what logging is enabled for each `HttpLogDetailLevel`:

| `HttpLogDetailLevel` value | Logging enabled |
| -------------------------- |-------------------------------------------------------------------------|
| `HttpLogDetailLevel.NONE` | No HTTP request or response logging |
| `HttpLogDetailLevel.BASIC` | HTTP request method, response status code, and request and response URL |
| `HttpLogDetailLevel.HEADERS` | All of `HttpLogDetailLevel.BASIC` and request and response headers if the log level is `verbose` |
| `HttpLogDetailLevel.BODY` | All of `HttpLogDetailLevel.BASIC` and request and response body if it's under 10KB in size |
| `HttpLogDetailLevel.BODY_AND_HEADERS` | All of `HttpLogDetailLevel.HEADERS` and `HttpLogDetailLevel.BODY` |


## Contributing

Expand All @@ -130,7 +158,7 @@ For details on contributing to this repository, see the [contributing guide](htt
5. Create new Pull Request

<!-- links -->
[logging]: https://github.com/Azure/azure-sdk-for-java/wiki/Logging-with-Azure-SDK
[logging]: https://learn.microsoft.com/azure/developer/java/sdk/logging-overview
[jdk_link]: https://docs.microsoft.com/java/azure/jdk/?view=azure-java-stable

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fcore%2Fazure-core%2FREADME.png)