HttpLogOptions Class

Definition

  • java.lang.Object
    • com.azure.core.http.policy.HttpLogOptions
public class HttpLogOptions

The log configurations for HTTP messages.

Constructors

HttpLogOptions()

Creates a new instance that does not log any information about HTTP requests or responses.

Methods

addAllowedHeaderName(String allowedHeaderName)

Sets the given whitelisted header to the default header set that should be logged.

addAllowedQueryParamName(String allowedQueryParamName)

Sets the given whitelisted query param that should be logged.

getAllowedHeaderNames()

Gets the whitelisted headers that should be logged.

getAllowedQueryParamNames()

Gets the whitelisted query parameters.

getApplicationId()

Gets the application specific id.

Deprecated. Use ClientOptions to configure applicationId.

getLogLevel()

Gets the level of detail to log on HTTP messages.

getRequestLogger()

Gets the HttpRequestLogger that will be used to log HTTP requests.

A default HttpRequestLogger will be used if one isn't supplied.

getResponseLogger()

Gets the HttpResponseLogger that will be used to log HTTP responses.

A default HttpResponseLogger will be used if one isn't supplied.

isPrettyPrintBody()

Gets flag to allow pretty printing of message bodies.

setAllowedHeaderNames(Set<String> allowedHeaderNames)

Sets the given whitelisted headers that should be logged.

This method sets the provided header names to be the whitelisted header names which will be logged for all HTTP requests and responses, overwriting any previously configured headers. Additionally, users can use addAllowedHeaderName(String allowedHeaderName) or getAllowedHeaderNames() to add or remove more headers names to the existing set of allowed header names.

setAllowedQueryParamNames(Set<String> allowedQueryParamNames)

Sets the given whitelisted query params to be displayed in the logging info.

setApplicationId(String applicationId)

Sets the custom application specific id supplied by the user of the client library.

Deprecated. Use ClientOptions to configure applicationId.

setLogLevel(HttpLogDetailLevel logLevel)

Sets the level of detail to log on Http messages.

If logLevel is not provided, default value of NONE is set.

setPrettyPrintBody(boolean prettyPrintBody)

Sets flag to allow pretty printing of message bodies.

setRequestLogger(HttpRequestLogger requestLogger)

Sets the HttpRequestLogger that will be used to log HTTP requests.

A default HttpRequestLogger will be used if one isn't supplied.

setResponseLogger(HttpResponseLogger responseLogger)

Sets the HttpResponseLogger that will be used to log HTTP responses.

A default HttpResponseLogger will be used if one isn't supplied.

Inherited Members

java.lang.Object.clone() java.lang.Object.equals(java.lang.Object) java.lang.Object.finalize() java.lang.Object.getClass() java.lang.Object.hashCode() java.lang.Object.notify() java.lang.Object.notifyAll() java.lang.Object.toString() java.lang.Object.wait() java.lang.Object.wait(long) java.lang.Object.wait(long,int)

Applies to