Class HttpResponseLoggingContext

java.lang.Object
com.azure.core.http.policy.HttpResponseLoggingContext

public final class HttpResponseLoggingContext extends Object
The HttpResponseLoggingContext class provides contextual information available during HTTP response logging.

This class is useful when you need to access information about an HTTP response during logging. It provides access to the HTTP response being received, the duration between the HTTP request being sent and the HTTP response being received, the contextual information about the response, and the try count for the request.

See Also:
  • Method Details

    • getHttpResponse

      public HttpResponse getHttpResponse()
      Gets the HTTP response being received.
      Returns:
      The HTTP response being received.
    • getResponseDuration

      public Duration getResponseDuration()
      Gets the duration between the HTTP request being sent and the HTTP response being received.
      Returns:
      The duration between the HTTP request being sent and the HTTP response being received.
    • getContext

      public Context getContext()
      Gets the contextual information about the HTTP response.
      Returns:
      The contextual information.
    • getTryCount

      public Integer getTryCount()
      Gets the try count for the HTTP request associated to the HTTP response.
      Returns:
      The HTTP request try count.