IHttpClientLogger.LogRequestFailed Method

Definition

Logs the exception happened while sending an HTTP request.

C#
public void LogRequestFailed (object? context, System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpResponseMessage? response, Exception exception, TimeSpan elapsed);

Parameters

context
Object

The context object that was previously returned by LogRequestStart(HttpRequestMessage).

request
HttpRequestMessage

The HTTP request message that was sent.

response
HttpResponseMessage

If available, the HTTP response message that was received, and null otherwise.

exception
Exception

Exception that happened during processing the HTTP request.

elapsed
TimeSpan

Time elapsed since calling LogRequestStart(HttpRequestMessage).

Applies to

Prodotto Versioni
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)