Class HttpLogOptions
- java.lang.Object
- 
- com.azure.android.core.http.policy.HttpLogOptions
 
- 
 public class HttpLogOptions extends java.lang.ObjectThe log configurations for HTTP messages.
- 
- 
Constructor SummaryConstructors Constructor Description HttpLogOptions()Creates a new instance that does not log any information about HTTP requests or responses.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpLogOptionsaddAllowedHeaderName(java.lang.String allowedHeaderName)Sets the given whitelisted header to the default header set that should be logged.HttpLogOptionsaddAllowedQueryParamName(java.lang.String allowedQueryParamName)Sets the given whitelisted query param that should be logged.java.util.Set<java.lang.String>getAllowedHeaderNames()Gets the whitelisted headers that should be logged.java.util.Set<java.lang.String>getAllowedQueryParamNames()Gets the whitelisted query parameters.HttpLogDetailLevelgetLogLevel()Gets the level of detail to log on HTTP messages.booleanisPrettyPrintBody()Gets flag to allow pretty printing of message bodies.HttpLogOptionssetAllowedHeaderNames(java.util.Set<java.lang.String> allowedHeaderNames)Sets the given whitelisted headers that should be logged.HttpLogOptionssetAllowedQueryParamNames(java.util.Set<java.lang.String> allowedQueryParamNames)Sets the given whitelisted query params to be displayed in the logging info.HttpLogOptionssetLogLevel(HttpLogDetailLevel logLevel)Sets the level of detail to log on Http messages.HttpLogOptionssetPrettyPrintBody(boolean prettyPrintBody)Sets flag to allow pretty printing of message bodies.
 
- 
- 
- 
Method Detail- 
getLogLevelpublic HttpLogDetailLevel getLogLevel() Gets the level of detail to log on HTTP messages.- Returns:
- The HttpLogDetailLevel.
 
 - 
setLogLevelpublic HttpLogOptions setLogLevel(HttpLogDetailLevel logLevel) Sets the level of detail to log on Http messages.If logLevel is not provided, default value of HttpLogDetailLevel.NONEis set.- Parameters:
- logLevel- The- HttpLogDetailLevel.
- Returns:
- The updated HttpLogOptions object.
 
 - 
getAllowedHeaderNamespublic java.util.Set<java.lang.String> getAllowedHeaderNames() Gets the whitelisted headers that should be logged.- Returns:
- The list of whitelisted headers.
 
 - 
setAllowedHeaderNamespublic HttpLogOptions setAllowedHeaderNames(java.util.Set<java.lang.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, including the default set. Additionally, users can use addAllowedHeaderName(String)orgetAllowedHeaderNames()to add or remove more headers names to the existing set of allowed header names.- Parameters:
- allowedHeaderNames- The list of whitelisted header names from the user.
- Returns:
- The updated HttpLogOptions object.
 
 - 
addAllowedHeaderNamepublic HttpLogOptions addAllowedHeaderName(java.lang.String allowedHeaderName) Sets the given whitelisted header to the default header set that should be logged.- Parameters:
- allowedHeaderName- The whitelisted header name from the user.
- Returns:
- The updated HttpLogOptions object.
- Throws:
- java.lang.NullPointerException- If- allowedHeaderNameis- null.
 
 - 
getAllowedQueryParamNamespublic java.util.Set<java.lang.String> getAllowedQueryParamNames() Gets the whitelisted query parameters.- Returns:
- The list of whitelisted query parameters.
 
 - 
setAllowedQueryParamNamespublic HttpLogOptions setAllowedQueryParamNames(java.util.Set<java.lang.String> allowedQueryParamNames) Sets the given whitelisted query params to be displayed in the logging info.- Parameters:
- allowedQueryParamNames- The list of whitelisted query params from the user.
- Returns:
- The updated HttpLogOptions object.
 
 - 
addAllowedQueryParamNamepublic HttpLogOptions addAllowedQueryParamName(java.lang.String allowedQueryParamName) Sets the given whitelisted query param that should be logged.- Parameters:
- allowedQueryParamName- The whitelisted query param name from the user.
- Returns:
- The updated HttpLogOptions object.
- Throws:
- java.lang.NullPointerException- If- allowedQueryParamNameis- null.
 
 - 
isPrettyPrintBodypublic boolean isPrettyPrintBody() Gets flag to allow pretty printing of message bodies.- Returns:
- true if pretty printing of message bodies is allowed.
 
 - 
setPrettyPrintBodypublic HttpLogOptions setPrettyPrintBody(boolean prettyPrintBody) Sets flag to allow pretty printing of message bodies.- Parameters:
- prettyPrintBody- If true, pretty prints message bodies when logging. If the detailLevel does not include body logging, this flag does nothing.
- Returns:
- The updated HttpLogOptions object.
 
 
- 
 
-