HttpLogOptions Class
- java.lang.Object
- com.azure.core.http.policy.HttpLogOptions
public class HttpLogOptions
The log configurations for HTTP messages.
Constructor Summary
Constructor | Description |
---|---|
HttpLogOptions() |
Creates a new instance that does not log any information about HTTP requests or responses. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Http |
addAllowedHeaderName(String allowedHeaderName)
Sets the given allowed header to the default header set that should be logged. |
Http |
addAllowedQueryParamName(String allowedQueryParamName)
Sets the given allowed query param that should be logged. |
Set<String> |
getAllowedHeaderNames()
Gets the allowed headers that should be logged. |
Set<String> |
getAllowedQueryParamNames()
Gets the allowed query parameters. |
String |
getApplicationId()
Deprecated
Use ClientOptions to configure
applicationId .
Gets the application specific id. |
Http |
getLogLevel()
Gets the level of detail to log on HTTP messages. |
Http |
getRequestLogger()
Gets the HttpRequestLogger that will be used to log HTTP requests. |
Http |
getResponseLogger()
Gets the HttpResponseLogger that will be used to log HTTP responses. |
boolean |
isPrettyPrintBody()
Gets flag to allow pretty printing of message bodies. |
Http |
setAllowedHeaderNames(Set<String> allowedHeaderNames)
Sets the given allowed headers that should be logged. |
Http |
setAllowedQueryParamNames(Set<String> allowedQueryParamNames)
Sets the given allowed query params to be displayed in the logging info. |
Http |
setApplicationId(String applicationId)
Deprecated
Use ClientOptions to configure
applicationId .
Sets the custom application specific id supplied by the user of the client library. |
Http |
setLogLevel(HttpLogDetailLevel logLevel)
Sets the level of detail to log on Http messages. |
Http |
setPrettyPrintBody(boolean prettyPrintBody)
Sets flag to allow pretty printing of message bodies. |
Http |
setRequestLogger(HttpRequestLogger requestLogger)
Sets the HttpRequestLogger that will be used to log HTTP requests. |
Http |
setResponseLogger(HttpResponseLogger responseLogger)
Sets the HttpResponseLogger that will be used to log HTTP responses. |
Methods inherited from java.lang.Object
Constructor Details
HttpLogOptions
public HttpLogOptions()
Creates a new instance that does not log any information about HTTP requests or responses.
Method Details
addAllowedHeaderName
public HttpLogOptions addAllowedHeaderName(String allowedHeaderName)
Sets the given allowed header to the default header set that should be logged.
Parameters:
Returns:
addAllowedQueryParamName
public HttpLogOptions addAllowedQueryParamName(String allowedQueryParamName)
Sets the given allowed query param that should be logged.
Parameters:
Returns:
getAllowedHeaderNames
public Set
Gets the allowed headers that should be logged.
Returns:
getAllowedQueryParamNames
public Set
Gets the allowed query parameters.
Returns:
getApplicationId
@Deprecated
public String getApplicationId()
Deprecated
applicationId
.
Gets the application specific id.
Returns:
getLogLevel
public HttpLogDetailLevel getLogLevel()
Gets the level of detail to log on HTTP messages.
Returns:
getRequestLogger
public HttpRequestLogger getRequestLogger()
Gets the HttpRequestLogger that will be used to log HTTP requests.
A default HttpRequestLogger will be used if one isn't supplied.
Returns:
getResponseLogger
public HttpResponseLogger getResponseLogger()
Gets the HttpResponseLogger that will be used to log HTTP responses.
A default HttpResponseLogger will be used if one isn't supplied.
Returns:
isPrettyPrintBody
public boolean isPrettyPrintBody()
Gets flag to allow pretty printing of message bodies.
Returns:
setAllowedHeaderNames
public HttpLogOptions setAllowedHeaderNames(Set
Sets the given allowed headers that should be logged.
This method sets the provided header names to be the allowed 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.
Parameters:
Returns:
setAllowedQueryParamNames
public HttpLogOptions setAllowedQueryParamNames(Set
Sets the given allowed query params to be displayed in the logging info.
Parameters:
Returns:
setApplicationId
@Deprecated
public HttpLogOptions setApplicationId(String applicationId)
Deprecated
applicationId
.
Sets the custom application specific id supplied by the user of the client library.
Parameters:
Returns:
setLogLevel
public HttpLogOptions setLogLevel(HttpLogDetailLevel logLevel)
Sets the level of detail to log on Http messages.
If logLevel is not provided, default value of NONE is set.
Parameters:
Returns:
setPrettyPrintBody
public HttpLogOptions setPrettyPrintBody(boolean prettyPrintBody)
Sets flag to allow pretty printing of message bodies.
Parameters:
Returns:
setRequestLogger
public HttpLogOptions 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.
Parameters:
Returns:
setResponseLogger
public HttpLogOptions 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.
Parameters:
Returns: