33 */
44package com .auth0 .client .mgmt ;
55
6- import com .auth0 .client .mgmt .core .ClientOptions ;
7- import com .auth0 .client .mgmt .core .CustomDomainInterceptor ;
8- import com .auth0 .client .mgmt .core .Environment ;
9- import com .auth0 .client .mgmt .core .OAuthTokenSupplier ;
6+ import com .auth0 .client .mgmt .core .*;
107import java .util .HashMap ;
118import java .util .Map ;
129import java .util .Optional ;
@@ -26,6 +23,8 @@ public class ManagementApiBuilder {
2623
2724 private OkHttpClient httpClient ;
2825
26+ private Optional <LogConfig > logging = Optional .empty ();
27+
2928 private String customDomain = null ;
3029
3130 // Domain-based initialization fields
@@ -168,6 +167,14 @@ public ManagementApiBuilder httpClient(OkHttpClient httpClient) {
168167 return this ;
169168 }
170169
170+ /**
171+ * Configure logging for the SDK. Silent by default — no log output unless explicitly configured.
172+ */
173+ public ManagementApiBuilder logging (LogConfig logging ) {
174+ this .logging = Optional .of (logging );
175+ return this ;
176+ }
177+
171178 /**
172179 * Add a custom header to be sent with all requests.
173180 * For headers that need to be computed dynamically or conditionally, use the setAdditional() method override instead.
@@ -188,6 +195,7 @@ protected ClientOptions buildClientOptions() {
188195 setHttpClient (builder );
189196 setTimeouts (builder );
190197 setRetries (builder );
198+ setLogging (builder );
191199 for (Map .Entry <String , String > header : this .customHeaders .entrySet ()) {
192200 builder .addHeader (header .getKey (), header .getValue ());
193201 }
@@ -293,6 +301,18 @@ protected void setHttpClient(ClientOptions.Builder builder) {
293301 }
294302 }
295303
304+ /**
305+ * Sets the logging configuration for the SDK.
306+ * Override this method to customize logging behavior.
307+ *
308+ * @param builder The ClientOptions.Builder to configure
309+ */
310+ protected void setLogging (ClientOptions .Builder builder ) {
311+ if (this .logging .isPresent ()) {
312+ builder .logging (this .logging .get ());
313+ }
314+ }
315+
296316 /**
297317 * Override this method to add any additional configuration to the client.
298318 * This method is called at the end of the configuration chain, allowing you to add
0 commit comments