public class HttpLogOptions extends Object
| Constructor and Description |
|---|
HttpLogOptions()
Creates a new instance that does not log any information about HTTP requests or responses.
|
| Modifier and Type | Method and Description |
|---|---|
HttpLogOptions |
addAllowedHeaderName(String allowedHeaderName)
Sets the given whitelisted header to the default header set that should be logged.
|
HttpLogOptions |
addAllowedQueryParamName(String allowedQueryParamName)
Sets the given whitelisted query param that should be logged.
|
Set<String> |
getAllowedHeaderNames()
Gets the whitelisted headers that should be logged.
|
Set<String> |
getAllowedQueryParamNames()
Gets the whitelisted query parameters.
|
String |
getApplicationId()
Deprecated.
Use
ClientOptions to configure applicationId. |
HttpLogDetailLevel |
getLogLevel()
Gets the level of detail to log on HTTP messages.
|
boolean |
isPrettyPrintBody()
Gets flag to allow pretty printing of message bodies.
|
HttpLogOptions |
setAllowedHeaderNames(Set<String> allowedHeaderNames)
Sets the given whitelisted headers that should be logged.
|
HttpLogOptions |
setAllowedQueryParamNames(Set<String> allowedQueryParamNames)
Sets the given whitelisted query params to be displayed in the logging info.
|
HttpLogOptions |
setApplicationId(String applicationId)
Deprecated.
Use
ClientOptions to configure applicationId. |
HttpLogOptions |
setLogLevel(HttpLogDetailLevel logLevel)
Sets the level of detail to log on Http messages.
|
HttpLogOptions |
setPrettyPrintBody(boolean prettyPrintBody)
Sets flag to allow pretty printing of message bodies.
|
public HttpLogOptions()
public HttpLogDetailLevel getLogLevel()
HttpLogDetailLevel.public HttpLogOptions setLogLevel(HttpLogDetailLevel logLevel)
If logLevel is not provided, default value of HttpLogDetailLevel.NONE is set.
logLevel - The HttpLogDetailLevel.public Set<String> getAllowedHeaderNames()
public HttpLogOptions setAllowedHeaderNames(Set<String> allowedHeaderNames)
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, including the default set. Additionally,
users can use HttpLogOptions.addAllowedHeaderName(String) or
HttpLogOptions.getAllowedHeaderNames() to add or remove more headers names to the existing set of
allowed header names.
allowedHeaderNames - The list of whitelisted header names from the user.public HttpLogOptions addAllowedHeaderName(String allowedHeaderName)
allowedHeaderName - The whitelisted header name from the user.NullPointerException - If allowedHeaderName is null.public Set<String> getAllowedQueryParamNames()
public HttpLogOptions setAllowedQueryParamNames(Set<String> allowedQueryParamNames)
allowedQueryParamNames - The list of whitelisted query params from the user.public HttpLogOptions addAllowedQueryParamName(String allowedQueryParamName)
allowedQueryParamName - The whitelisted query param name from the user.NullPointerException - If allowedQueryParamName is null.@Deprecated public String getApplicationId()
ClientOptions to configure applicationId.@Deprecated public HttpLogOptions setApplicationId(String applicationId)
ClientOptions to configure applicationId.applicationId - The user specified application id.public boolean isPrettyPrintBody()
public HttpLogOptions setPrettyPrintBody(boolean prettyPrintBody)
prettyPrintBody - If true, pretty prints message bodies when logging. If the detailLevel does not
include body logging, this flag does nothing.Copyright © 2020 Microsoft Corporation. All rights reserved.