IHttpClientLogEnricher.Enrich 方法

定义

扩充 HTTP 客户端请求日志。

public:
 void Enrich(Microsoft::Extensions::Diagnostics::Enrichment::IEnrichmentTagCollector ^ collector, System::Net::Http::HttpRequestMessage ^ request, System::Net::Http::HttpResponseMessage ^ response, Exception ^ exception);
public void Enrich (Microsoft.Extensions.Diagnostics.Enrichment.IEnrichmentTagCollector collector, System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpResponseMessage? response, Exception? exception);
abstract member Enrich : Microsoft.Extensions.Diagnostics.Enrichment.IEnrichmentTagCollector * System.Net.Http.HttpRequestMessage * System.Net.Http.HttpResponseMessage * Exception -> unit
Public Sub Enrich (collector As IEnrichmentTagCollector, request As HttpRequestMessage, response As HttpResponseMessage, exception As Exception)

参数

collector
IEnrichmentTagCollector

要向其添加标记的标记收集器。

request
HttpRequestMessage

HttpRequestMessage 与传出 HTTP 请求关联的 对象。

response
HttpResponseMessage

HttpResponseMessage 与传出 HTTP 请求关联的 对象。

exception
Exception

在传出 HTTP 请求处理中引发的可选 Exception

注解

请注意,根据 HTTP 请求的结果, responseexception 参数可能是 null

适用于