diff --git a/sdk/clientcore/core/src/main/java/io/clientcore/core/http/pipeline/HttpLoggingPolicy.java b/sdk/clientcore/core/src/main/java/io/clientcore/core/http/pipeline/HttpLoggingPolicy.java index 373498d34fe53..c43ebca9a3c37 100644 --- a/sdk/clientcore/core/src/main/java/io/clientcore/core/http/pipeline/HttpLoggingPolicy.java +++ b/sdk/clientcore/core/src/main/java/io/clientcore/core/http/pipeline/HttpLoggingPolicy.java @@ -103,7 +103,7 @@ public Response process(HttpRequest httpRequest, HttpPipelineNextPolicy next) } private ClientLogger getLogger(HttpRequest request) { - if (request.getRequestOptions() != null) { + if (request.getRequestOptions() != null && request.getRequestOptions().getLogger() != null) { return request.getRequestOptions().getLogger(); }