Freigeben über


IHttpClientLogger.LogRequestFailed Method

Definition

Logs the exception happened while sending an HTTP request.

public:
 void LogRequestFailed(System::Object ^ context, System::Net::Http::HttpRequestMessage ^ request, System::Net::Http::HttpResponseMessage ^ response, Exception ^ exception, TimeSpan elapsed);
public void LogRequestFailed (object? context, System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpResponseMessage? response, Exception exception, TimeSpan elapsed);
abstract member LogRequestFailed : obj * System.Net.Http.HttpRequestMessage * System.Net.Http.HttpResponseMessage * Exception * TimeSpan -> unit
Public Sub LogRequestFailed (context As Object, request As HttpRequestMessage, response As HttpResponseMessage, exception As Exception, elapsed As TimeSpan)

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