86 строки
8.4 KiB
YAML
86 строки
8.4 KiB
YAML
### YamlMime:JavaType
|
|
uid: "com.azure.core.http.policy.HttpLoggingPolicy"
|
|
fullName: "com.azure.core.http.policy.HttpLoggingPolicy"
|
|
name: "HttpLoggingPolicy"
|
|
nameWithType: "HttpLoggingPolicy"
|
|
summary: "The `HttpLoggingPolicy` class is an implementation of the <xref uid=\"com.azure.core.http.policy.HttpPipelinePolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipelinePolicy\"></xref> interface."
|
|
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 **HttpLoggingPolicy**</br> implements <xref href=\"com.azure.core.http.policy.HttpPipelinePolicy?alt=com.azure.core.http.policy.HttpPipelinePolicy&text=HttpPipelinePolicy\" data-throw-if-not-resolved=\"False\" />"
|
|
constructors:
|
|
- uid: "com.azure.core.http.policy.HttpLoggingPolicy.HttpLoggingPolicy(com.azure.core.http.policy.HttpLogOptions)"
|
|
fullName: "com.azure.core.http.policy.HttpLoggingPolicy.HttpLoggingPolicy(HttpLogOptions httpLogOptions)"
|
|
name: "HttpLoggingPolicy(HttpLogOptions httpLogOptions)"
|
|
nameWithType: "HttpLoggingPolicy.HttpLoggingPolicy(HttpLogOptions httpLogOptions)"
|
|
summary: "Creates an Http<wbr>Logging<wbr>Policy with the given log configurations."
|
|
parameters:
|
|
- description: "The HTTP logging configuration options."
|
|
name: "httpLogOptions"
|
|
type: "<xref href=\"com.azure.core.http.policy.HttpLogOptions?alt=com.azure.core.http.policy.HttpLogOptions&text=HttpLogOptions\" data-throw-if-not-resolved=\"False\" />"
|
|
syntax: "public HttpLoggingPolicy(HttpLogOptions httpLogOptions)"
|
|
desc: "Creates an HttpLoggingPolicy with the given log configurations."
|
|
fields:
|
|
- uid: "com.azure.core.http.policy.HttpLoggingPolicy.RETRY_COUNT_CONTEXT"
|
|
fullName: "com.azure.core.http.policy.HttpLoggingPolicy.RETRY_COUNT_CONTEXT"
|
|
name: "RETRY_COUNT_CONTEXT"
|
|
nameWithType: "HttpLoggingPolicy.RETRY_COUNT_CONTEXT"
|
|
summary: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> to pass request retry count metadata for logging."
|
|
modifiers:
|
|
- "static"
|
|
- "final"
|
|
field:
|
|
value: "requestRetryCount"
|
|
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
|
|
syntax: "public static final String RETRY_COUNT_CONTEXT"
|
|
desc: "Key for <xref uid=\"com.azure.core.util.Context\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Context\"></xref> to pass request retry count metadata for logging."
|
|
methods:
|
|
- uid: "com.azure.core.http.policy.HttpLoggingPolicy.process(com.azure.core.http.HttpPipelineCallContext,com.azure.core.http.HttpPipelineNextPolicy)"
|
|
fullName: "com.azure.core.http.policy.HttpLoggingPolicy.process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
|
|
name: "process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
|
|
nameWithType: "HttpLoggingPolicy.process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
|
|
summary: "Processes provided request context and invokes the next policy."
|
|
parameters:
|
|
- name: "context"
|
|
type: "<xref href=\"com.azure.core.http.HttpPipelineCallContext?alt=com.azure.core.http.HttpPipelineCallContext&text=HttpPipelineCallContext\" data-throw-if-not-resolved=\"False\" />"
|
|
- name: "next"
|
|
type: "<xref href=\"com.azure.core.http.HttpPipelineNextPolicy?alt=com.azure.core.http.HttpPipelineNextPolicy&text=HttpPipelineNextPolicy\" data-throw-if-not-resolved=\"False\" />"
|
|
syntax: "public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
|
|
desc: "Processes provided request context and invokes the next policy."
|
|
returns:
|
|
type: "<a href=\"https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html\">Mono</a><<xref href=\"com.azure.core.http.HttpResponse?alt=com.azure.core.http.HttpResponse&text=HttpResponse\" data-throw-if-not-resolved=\"False\" />>"
|
|
- uid: "com.azure.core.http.policy.HttpLoggingPolicy.processSync(com.azure.core.http.HttpPipelineCallContext,com.azure.core.http.HttpPipelineNextSyncPolicy)"
|
|
fullName: "com.azure.core.http.policy.HttpLoggingPolicy.processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
|
|
name: "processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
|
|
nameWithType: "HttpLoggingPolicy.processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
|
|
summary: "Processes provided request context and invokes the next policy synchronously."
|
|
parameters:
|
|
- name: "context"
|
|
type: "<xref href=\"com.azure.core.http.HttpPipelineCallContext?alt=com.azure.core.http.HttpPipelineCallContext&text=HttpPipelineCallContext\" data-throw-if-not-resolved=\"False\" />"
|
|
- name: "next"
|
|
type: "<xref href=\"com.azure.core.http.HttpPipelineNextSyncPolicy?alt=com.azure.core.http.HttpPipelineNextSyncPolicy&text=HttpPipelineNextSyncPolicy\" data-throw-if-not-resolved=\"False\" />"
|
|
syntax: "public HttpResponse processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
|
|
desc: "Processes provided request context and invokes the next policy synchronously."
|
|
returns:
|
|
type: "<xref href=\"com.azure.core.http.HttpResponse?alt=com.azure.core.http.HttpResponse&text=HttpResponse\" data-throw-if-not-resolved=\"False\" />"
|
|
type: "class"
|
|
desc: "The `HttpLoggingPolicy` class is an implementation of the <xref uid=\"com.azure.core.http.policy.HttpPipelinePolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipelinePolicy\"></xref> interface. This policy handles logging of HTTP requests and responses based on the provided <xref uid=\"com.azure.core.http.policy.HttpLogOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpLogOptions\"></xref>.\n\nThis class is useful when you need to log HTTP traffic for debugging or auditing purposes. It allows you to control the amount of information that is logged, including the URL, headers, and body of requests and responses.\n\n**NOTE:** Enabling body logging (using the <xref uid=\"com.azure.core.http.policy.HttpLogDetailLevel.BODY\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BODY\"></xref> or <xref uid=\"com.azure.core.http.policy.HttpLogDetailLevel.BODY_AND_HEADERS\" data-throw-if-not-resolved=\"false\" data-raw-source=\"BODY_AND_HEADERS\"></xref> levels) will buffer the response body into memory even if it is never consumed by your application, possibly impacting performance.\n\n**Code sample:**\n\nIn this example, an `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 `HttpLogOptions` is then used to create an `HttpLoggingPolicy`, which can then added to the pipeline.\n\n```java\nHttpLogOptions logOptions = new HttpLogOptions();\n logOptions.setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS);\n HttpLoggingPolicy loggingPolicy = new HttpLoggingPolicy(logOptions);\n```"
|
|
implements:
|
|
- "<xref href=\"com.azure.core.http.policy.HttpPipelinePolicy?alt=com.azure.core.http.policy.HttpPipelinePolicy&text=HttpPipelinePolicy\" data-throw-if-not-resolved=\"False\" />"
|
|
metadata: {}
|
|
package: "com.azure.core.http.policy"
|
|
artifact: com.azure:azure-core:1.54.0
|