dotnet / dotnet/dotnet-api-docs

Need more information on when and how to use this interface

Open
#11,371 7 comments 0 reactions 0 assignees View on GitHub
:books: documentation area-System.Net.Http untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

### Type of issue

Missing information

### Description

This interface appears to be useful for capturing additional information into a structured form usable by structured loggers. But there is no documentation on the actual usage of this interface nor any examples. The only reason I found this is because of the extension method, that is also not well documented, over [here](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.dependencyinjection.httpclientloggingservicecollectionextensions.addhttpclientlogenricher?view=net-9.0-pp).

It would be nice to get some discussion on when this is useful and what to do with it. While I can see where it is possible to add a new enricher, the `IEnrichmentTagCollector` that enrichers write to doesn't seem to be accessible anywhere else. So if I wanted to use an enricher to add some data to logging then I could create my own enricher. But I don't see any way to later write a logger, or whatever, that then has access to this collection of enriched data.

### Page URL

https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.http.logging.ihttpclientlogenricher?view=net-9.0-pp

### Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/Microsoft.Extensions.Http.Logging/IHttpClientLogEnricher.xml

### Document Version Independent Id

6a9aad43-d09a-0706-1a59-3c44856344a9

### Platform Id

bddae806-f751-afd0-bc13-29d59da12b47

### Article author

@dotnet-bot

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.