azure-docs-sdk-java/docs-ref-autogen/com.azure.core.http.policy....

262 строки
24 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.core.http.policy.HttpLogOptions"
fullName: "com.azure.core.http.policy.HttpLogOptions"
name: "HttpLogOptions"
nameWithType: "HttpLogOptions"
summary: "The `HttpLogOptions` class provides configuration options for HTTP logging."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public class **HttpLogOptions**"
constructors:
- uid: "com.azure.core.http.policy.HttpLogOptions.HttpLogOptions()"
fullName: "com.azure.core.http.policy.HttpLogOptions.HttpLogOptions()"
name: "HttpLogOptions()"
nameWithType: "HttpLogOptions.HttpLogOptions()"
summary: "Creates a new instance that does not log any information about HTTP requests or responses."
syntax: "public HttpLogOptions()"
desc: "Creates a new instance that does not log any information about HTTP requests or responses."
methods:
- uid: "com.azure.core.http.policy.HttpLogOptions.addAllowedHeaderName(java.lang.String)"
fullName: "com.azure.core.http.policy.HttpLogOptions.addAllowedHeaderName(String allowedHeaderName)"
name: "addAllowedHeaderName(String allowedHeaderName)"
nameWithType: "HttpLogOptions.addAllowedHeaderName(String allowedHeaderName)"
summary: "Sets the given allowed header to the default header set that should be logged."
parameters:
- description: "The allowed header name from the user."
name: "allowedHeaderName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public HttpLogOptions addAllowedHeaderName(String allowedHeaderName)"
desc: "Sets the given allowed header to the default header set that should be logged."
returns:
description: "The updated HttpLogOptions object."
type: "<xref href=\"com.azure.core.http.policy.HttpLogOptions?alt=com.azure.core.http.policy.HttpLogOptions&text=HttpLogOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.addAllowedQueryParamName(java.lang.String)"
fullName: "com.azure.core.http.policy.HttpLogOptions.addAllowedQueryParamName(String allowedQueryParamName)"
name: "addAllowedQueryParamName(String allowedQueryParamName)"
nameWithType: "HttpLogOptions.addAllowedQueryParamName(String allowedQueryParamName)"
summary: "Sets the given allowed query param that should be logged."
parameters:
- description: "The allowed query param name from the user."
name: "allowedQueryParamName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public HttpLogOptions addAllowedQueryParamName(String allowedQueryParamName)"
desc: "Sets the given allowed query param that should be logged."
returns:
description: "The updated HttpLogOptions object."
type: "<xref href=\"com.azure.core.http.policy.HttpLogOptions?alt=com.azure.core.http.policy.HttpLogOptions&text=HttpLogOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.disableRedactedHeaderLogging(boolean)"
fullName: "com.azure.core.http.policy.HttpLogOptions.disableRedactedHeaderLogging(boolean disableRedactedHeaderLogging)"
name: "disableRedactedHeaderLogging(boolean disableRedactedHeaderLogging)"
nameWithType: "HttpLogOptions.disableRedactedHeaderLogging(boolean disableRedactedHeaderLogging)"
summary: "Sets the flag that controls if header names which value is redacted should be logged."
parameters:
- description: "If true, redacted header names are not logged.\n Otherwise, they are logged as a comma separated list under `redactedHeaders` property."
name: "disableRedactedHeaderLogging"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
syntax: "public HttpLogOptions disableRedactedHeaderLogging(boolean disableRedactedHeaderLogging)"
desc: "Sets the flag that controls if header names which value is redacted should be logged.\n\nApplies only if logging request and response headers is enabled. See <xref uid=\"com.azure.core.http.policy.HttpLogOptions.setLogLevel(com.azure.core.http.policy.HttpLogDetailLevel)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpLogOptions#setLogLevel(HttpLogDetailLevel)\"></xref> for details. Defaults to \\`false\\` - redacted header names are logged."
returns:
description: "The updated HttpLogOptions object."
type: "<xref href=\"com.azure.core.http.policy.HttpLogOptions?alt=com.azure.core.http.policy.HttpLogOptions&text=HttpLogOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.getAllowedHeaderNames()"
fullName: "com.azure.core.http.policy.HttpLogOptions.getAllowedHeaderNames()"
name: "getAllowedHeaderNames()"
nameWithType: "HttpLogOptions.getAllowedHeaderNames()"
summary: "Gets the allowed headers that should be logged."
syntax: "public Set<String> getAllowedHeaderNames()"
desc: "Gets the allowed headers that should be logged."
returns:
description: "The list of allowed headers."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Set.html\">Set</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- uid: "com.azure.core.http.policy.HttpLogOptions.getAllowedQueryParamNames()"
fullName: "com.azure.core.http.policy.HttpLogOptions.getAllowedQueryParamNames()"
name: "getAllowedQueryParamNames()"
nameWithType: "HttpLogOptions.getAllowedQueryParamNames()"
summary: "Gets the allowed query parameters."
syntax: "public Set<String> getAllowedQueryParamNames()"
desc: "Gets the allowed query parameters."
returns:
description: "The list of allowed query parameters."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Set.html\">Set</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- uid: "com.azure.core.http.policy.HttpLogOptions.getApplicationId()"
fullName: "com.azure.core.http.policy.HttpLogOptions.getApplicationId()"
name: "getApplicationId()"
nameWithType: "HttpLogOptions.getApplicationId()"
summary: "Gets the application specific id."
deprecatedTag: "Use <xref uid=\"com.azure.core.util.ClientOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientOptions\"></xref> to configure `applicationId`."
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public String getApplicationId()"
desc: "Gets the application specific id."
hasDeprecatedTag: true
returns:
description: "The application specific id."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.core.http.policy.HttpLogOptions.getLogLevel()"
fullName: "com.azure.core.http.policy.HttpLogOptions.getLogLevel()"
name: "getLogLevel()"
nameWithType: "HttpLogOptions.getLogLevel()"
summary: "Gets the level of detail to log on HTTP messages."
syntax: "public HttpLogDetailLevel getLogLevel()"
desc: "Gets the level of detail to log on HTTP messages."
returns:
description: "The <xref uid=\"com.azure.core.http.policy.HttpLogDetailLevel\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpLogDetailLevel\"></xref>."
type: "<xref href=\"com.azure.core.http.policy.HttpLogDetailLevel?alt=com.azure.core.http.policy.HttpLogDetailLevel&text=HttpLogDetailLevel\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.getRequestLogger()"
fullName: "com.azure.core.http.policy.HttpLogOptions.getRequestLogger()"
name: "getRequestLogger()"
nameWithType: "HttpLogOptions.getRequestLogger()"
summary: "Gets the <xref uid=\"com.azure.core.http.policy.HttpRequestLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequestLogger\"></xref> that will be used to log HTTP requests."
syntax: "public HttpRequestLogger getRequestLogger()"
desc: "Gets the <xref uid=\"com.azure.core.http.policy.HttpRequestLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequestLogger\"></xref> that will be used to log HTTP requests.\n\nA default <xref uid=\"com.azure.core.http.policy.HttpRequestLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequestLogger\"></xref> will be used if one isn't supplied."
returns:
description: "The <xref uid=\"com.azure.core.http.policy.HttpRequestLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequestLogger\"></xref> that will be used to log HTTP requests."
type: "<xref href=\"com.azure.core.http.policy.HttpRequestLogger?alt=com.azure.core.http.policy.HttpRequestLogger&text=HttpRequestLogger\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.getResponseLogger()"
fullName: "com.azure.core.http.policy.HttpLogOptions.getResponseLogger()"
name: "getResponseLogger()"
nameWithType: "HttpLogOptions.getResponseLogger()"
summary: "Gets the <xref uid=\"com.azure.core.http.policy.HttpResponseLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpResponseLogger\"></xref> that will be used to log HTTP responses."
syntax: "public HttpResponseLogger getResponseLogger()"
desc: "Gets the <xref uid=\"com.azure.core.http.policy.HttpResponseLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpResponseLogger\"></xref> that will be used to log HTTP responses.\n\nA default <xref uid=\"com.azure.core.http.policy.HttpResponseLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpResponseLogger\"></xref> will be used if one isn't supplied."
returns:
description: "The <xref uid=\"com.azure.core.http.policy.HttpResponseLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpResponseLogger\"></xref> that will be used to log HTTP responses."
type: "<xref href=\"com.azure.core.http.policy.HttpResponseLogger?alt=com.azure.core.http.policy.HttpResponseLogger&text=HttpResponseLogger\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.isPrettyPrintBody()"
fullName: "com.azure.core.http.policy.HttpLogOptions.isPrettyPrintBody()"
name: "isPrettyPrintBody()"
nameWithType: "HttpLogOptions.isPrettyPrintBody()"
summary: "Gets flag to allow pretty printing of message bodies."
syntax: "public boolean isPrettyPrintBody()"
desc: "Gets flag to allow pretty printing of message bodies."
returns:
description: "true if pretty printing of message bodies is allowed."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.isRedactedHeaderLoggingDisabled()"
fullName: "com.azure.core.http.policy.HttpLogOptions.isRedactedHeaderLoggingDisabled()"
name: "isRedactedHeaderLoggingDisabled()"
nameWithType: "HttpLogOptions.isRedactedHeaderLoggingDisabled()"
summary: "Gets the flag that controls if header names with redacted values should be logged."
syntax: "public boolean isRedactedHeaderLoggingDisabled()"
desc: "Gets the flag that controls if header names with redacted values should be logged."
returns:
description: "true if header names with redacted values should be logged."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.setAllowedHeaderNames(java.util.Set<java.lang.String>)"
fullName: "com.azure.core.http.policy.HttpLogOptions.setAllowedHeaderNames(Set<String> allowedHeaderNames)"
name: "setAllowedHeaderNames(Set<String> allowedHeaderNames)"
nameWithType: "HttpLogOptions.setAllowedHeaderNames(Set<String> allowedHeaderNames)"
summary: "Sets the given allowed headers that should be logged."
parameters:
- description: "The list of allowed header names from the user."
name: "allowedHeaderNames"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Set.html\">Set</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "public HttpLogOptions setAllowedHeaderNames(Set<String> allowedHeaderNames)"
desc: "Sets the given allowed headers that should be logged.\n\nThis 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 <xref uid=\"com.azure.core.http.policy.HttpLogOptions.addAllowedHeaderName(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpLogOptions#addAllowedHeaderName(String)\"></xref> or <xref uid=\"com.azure.core.http.policy.HttpLogOptions.getAllowedHeaderNames()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpLogOptions#getAllowedHeaderNames()\"></xref> to add or remove more headers names to the existing set of allowed header names."
returns:
description: "The updated HttpLogOptions object."
type: "<xref href=\"com.azure.core.http.policy.HttpLogOptions?alt=com.azure.core.http.policy.HttpLogOptions&text=HttpLogOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.setAllowedQueryParamNames(java.util.Set<java.lang.String>)"
fullName: "com.azure.core.http.policy.HttpLogOptions.setAllowedQueryParamNames(Set<String> allowedQueryParamNames)"
name: "setAllowedQueryParamNames(Set<String> allowedQueryParamNames)"
nameWithType: "HttpLogOptions.setAllowedQueryParamNames(Set<String> allowedQueryParamNames)"
summary: "Sets the given allowed query params to be displayed in the logging info."
parameters:
- description: "The list of allowed query params from the user."
name: "allowedQueryParamNames"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Set.html\">Set</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "public HttpLogOptions setAllowedQueryParamNames(Set<String> allowedQueryParamNames)"
desc: "Sets the given allowed query params to be displayed in the logging info."
returns:
description: "The updated HttpLogOptions object."
type: "<xref href=\"com.azure.core.http.policy.HttpLogOptions?alt=com.azure.core.http.policy.HttpLogOptions&text=HttpLogOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.setApplicationId(java.lang.String)"
fullName: "com.azure.core.http.policy.HttpLogOptions.setApplicationId(String applicationId)"
name: "setApplicationId(String applicationId)"
nameWithType: "HttpLogOptions.setApplicationId(String applicationId)"
summary: "Sets the custom application specific id supplied by the user of the client library."
deprecatedTag: "Use <xref uid=\"com.azure.core.util.ClientOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ClientOptions\"></xref> to configure `applicationId`."
parameters:
- description: "The user specified application id."
name: "applicationId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public HttpLogOptions setApplicationId(String applicationId)"
desc: "Sets the custom application specific id supplied by the user of the client library."
hasDeprecatedTag: true
returns:
description: "The updated HttpLogOptions object."
type: "<xref href=\"com.azure.core.http.policy.HttpLogOptions?alt=com.azure.core.http.policy.HttpLogOptions&text=HttpLogOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.setLogLevel(com.azure.core.http.policy.HttpLogDetailLevel)"
fullName: "com.azure.core.http.policy.HttpLogOptions.setLogLevel(HttpLogDetailLevel logLevel)"
name: "setLogLevel(HttpLogDetailLevel logLevel)"
nameWithType: "HttpLogOptions.setLogLevel(HttpLogDetailLevel logLevel)"
summary: "Sets the level of detail to log on Http messages."
parameters:
- description: "The <xref uid=\"com.azure.core.http.policy.HttpLogDetailLevel\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpLogDetailLevel\"></xref>."
name: "logLevel"
type: "<xref href=\"com.azure.core.http.policy.HttpLogDetailLevel?alt=com.azure.core.http.policy.HttpLogDetailLevel&text=HttpLogDetailLevel\" data-throw-if-not-resolved=\"False\" />"
syntax: "public HttpLogOptions setLogLevel(HttpLogDetailLevel logLevel)"
desc: "Sets the level of detail to log on Http messages.\n\nIf logLevel is not provided, default value of <xref uid=\"com.azure.core.http.policy.HttpLogDetailLevel.NONE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpLogDetailLevel#NONE\"></xref> is set."
returns:
description: "The updated HttpLogOptions object."
type: "<xref href=\"com.azure.core.http.policy.HttpLogOptions?alt=com.azure.core.http.policy.HttpLogOptions&text=HttpLogOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.setPrettyPrintBody(boolean)"
fullName: "com.azure.core.http.policy.HttpLogOptions.setPrettyPrintBody(boolean prettyPrintBody)"
name: "setPrettyPrintBody(boolean prettyPrintBody)"
nameWithType: "HttpLogOptions.setPrettyPrintBody(boolean prettyPrintBody)"
summary: "Sets flag to allow pretty printing of message bodies."
parameters:
- description: "If true, pretty prints message bodies when logging. If the detailLevel does not include\n body logging, this flag does nothing."
name: "prettyPrintBody"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
syntax: "public HttpLogOptions setPrettyPrintBody(boolean prettyPrintBody)"
desc: "Sets flag to allow pretty printing of message bodies."
returns:
description: "The updated HttpLogOptions object."
type: "<xref href=\"com.azure.core.http.policy.HttpLogOptions?alt=com.azure.core.http.policy.HttpLogOptions&text=HttpLogOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.setRequestLogger(com.azure.core.http.policy.HttpRequestLogger)"
fullName: "com.azure.core.http.policy.HttpLogOptions.setRequestLogger(HttpRequestLogger requestLogger)"
name: "setRequestLogger(HttpRequestLogger requestLogger)"
nameWithType: "HttpLogOptions.setRequestLogger(HttpRequestLogger requestLogger)"
summary: "Sets the <xref uid=\"com.azure.core.http.policy.HttpRequestLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequestLogger\"></xref> that will be used to log HTTP requests."
parameters:
- description: "The <xref uid=\"com.azure.core.http.policy.HttpRequestLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequestLogger\"></xref> that will be used to log HTTP requests."
name: "requestLogger"
type: "<xref href=\"com.azure.core.http.policy.HttpRequestLogger?alt=com.azure.core.http.policy.HttpRequestLogger&text=HttpRequestLogger\" data-throw-if-not-resolved=\"False\" />"
syntax: "public HttpLogOptions setRequestLogger(HttpRequestLogger requestLogger)"
desc: "Sets the <xref uid=\"com.azure.core.http.policy.HttpRequestLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequestLogger\"></xref> that will be used to log HTTP requests.\n\nA default <xref uid=\"com.azure.core.http.policy.HttpRequestLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequestLogger\"></xref> will be used if one isn't supplied."
returns:
description: "The updated HttpLogOptions object."
type: "<xref href=\"com.azure.core.http.policy.HttpLogOptions?alt=com.azure.core.http.policy.HttpLogOptions&text=HttpLogOptions\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.http.policy.HttpLogOptions.setResponseLogger(com.azure.core.http.policy.HttpResponseLogger)"
fullName: "com.azure.core.http.policy.HttpLogOptions.setResponseLogger(HttpResponseLogger responseLogger)"
name: "setResponseLogger(HttpResponseLogger responseLogger)"
nameWithType: "HttpLogOptions.setResponseLogger(HttpResponseLogger responseLogger)"
summary: "Sets the <xref uid=\"com.azure.core.http.policy.HttpResponseLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpResponseLogger\"></xref> that will be used to log HTTP responses."
parameters:
- description: "The <xref uid=\"com.azure.core.http.policy.HttpResponseLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpResponseLogger\"></xref> that will be used to log HTTP responses."
name: "responseLogger"
type: "<xref href=\"com.azure.core.http.policy.HttpResponseLogger?alt=com.azure.core.http.policy.HttpResponseLogger&text=HttpResponseLogger\" data-throw-if-not-resolved=\"False\" />"
syntax: "public HttpLogOptions setResponseLogger(HttpResponseLogger responseLogger)"
desc: "Sets the <xref uid=\"com.azure.core.http.policy.HttpResponseLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpResponseLogger\"></xref> that will be used to log HTTP responses.\n\nA default <xref uid=\"com.azure.core.http.policy.HttpResponseLogger\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpResponseLogger\"></xref> will be used if one isn't supplied."
returns:
description: "The updated HttpLogOptions object."
type: "<xref href=\"com.azure.core.http.policy.HttpLogOptions?alt=com.azure.core.http.policy.HttpLogOptions&text=HttpLogOptions\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "The `HttpLogOptions` class provides configuration options for HTTP logging. This includes setting the log level, specifying allowed header names and query parameters for logging, and controlling whether to pretty print the body of HTTP messages.\n\nThis class is useful when you need to control the amount of information that is logged during the execution of HTTP requests and responses. It allows you to specify the log level, which determines the amount of detail included in the logs (such as the URL, headers, and body of requests and responses).\n\n**Code sample:**\n\nIn this example, the `HttpLogOptions` is created and the log level is set to `HttpLogDetailLevel.BODY_AND_HEADERS`. This means that the URL, HTTP method, headers, and body content of each request and response will be logged. The allowed header names and query parameters for logging are also specified, and pretty printing of the body is enabled. The `HttpLogOptions` is then used to create an `HttpLoggingPolicy`, which can then be added to the pipeline.\n\n```java\nHttpLogOptions logOptions = new HttpLogOptions();\n logOptions.setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS);\n logOptions.setAllowedHeaderNames(new HashSet<>(Arrays.asList(\"Date\", \"x-ms-request-id\")));\n logOptions.setAllowedQueryParamNames(new HashSet<>(Arrays.asList(\"api-version\")));\n logOptions.setPrettyPrintBody(true);\n HttpLoggingPolicy loggingPolicy = new HttpLoggingPolicy(logOptions);\n```"
metadata: {}
package: "com.azure.core.http.policy"
artifact: com.azure:azure-core:1.52.0