5 implementations of IHttpClientLogEnricher
Microsoft.Extensions.Http.Diagnostics (1)
Latency\Internal\HttpClientLatencyLogEnricher.cs (1)
22internal sealed class HttpClientLatencyLogEnricher : IHttpClientLogEnricher
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (1)
BenchEnricher.cs (1)
10internal sealed class BenchEnricher : IHttpClientLogEnricher
Microsoft.Extensions.Http.Diagnostics.Tests (3)
Logging\Internal\EmptyEnricher.cs (1)
10internal class EmptyEnricher : IHttpClientLogEnricher
Logging\Internal\EnricherWithCounter.cs (1)
10internal class EnricherWithCounter : IHttpClientLogEnricher
Logging\Internal\TestEnricher.cs (1)
12internal class TestEnricher : IHttpClientLogEnricher
39 references to IHttpClientLogEnricher
Microsoft.Extensions.Http.Diagnostics (6)
Logging\HttpClientLoggingServiceCollectionExtensions.cs (2)
102where T : class, IHttpClientLogEnricher 103=> Throw.IfNull(services).AddActivatedSingleton<IHttpClientLogEnricher, T>();
Logging\Internal\HttpClientLogger.cs (4)
37private IHttpClientLogEnricher[] _enrichers; 42IEnumerable<IHttpClientLogEnricher> enrichers, 56IEnumerable<IHttpClientLogEnricher> enrichers, 226foreach (var enricher in _enrichers)
Microsoft.Extensions.Http.Diagnostics.Tests (33)
Logging\AcceptanceTests.cs (7)
35.AddSingleton<IHttpClientLogEnricher>(static _ => null!) 50var enrichers = sp.GetServices<IHttpClientLogEnricher>().ToList(); 51var nullEnricher = Assert.Single(enrichers, x => x is null); 54var enricher = Assert.Single(enrichers, x => x is not null); 66.AddSingleton<IHttpClientLogEnricher, TestEnricher>(static _ => new TestEnricher(throwOnEnrich: true)) 118var enricher1 = sp.GetServices<IHttpClientLogEnricher>().SingleOrDefault(enn => enn is EnricherWithCounter) as EnricherWithCounter; 119var enricher2 = sp.GetServices<IHttpClientLogEnricher>().SingleOrDefault(enn => enn is TestEnricher) as TestEnricher;
Logging\HttpClientLoggerTest.cs (24)
66Empty.Enumerable<IHttpClientLogEnricher>(), 101Enumerable.Empty<IHttpClientLogEnricher>(), 144Enumerable.Empty<IHttpClientLogEnricher>(), 230new List<IHttpClientLogEnricher> { testEnricher }, 326new List<IHttpClientLogEnricher> { testEnricher }, 431new List<IHttpClientLogEnricher> { testEnricher }, 546new List<IHttpClientLogEnricher> { testEnricher }, 639new List<IHttpClientLogEnricher> { testEnricher }, 665var enricher1 = new Mock<IHttpClientLogEnricher>(); 666var enricher2 = new Mock<IHttpClientLogEnricher>(); 682new List<IHttpClientLogEnricher> { enricher1.Object, enricher2.Object }, 706var enricher1 = new Mock<IHttpClientLogEnricher>(); 707var enricher2 = new Mock<IHttpClientLogEnricher>(); 725new List<IHttpClientLogEnricher> { enricher1.Object, enricher2.Object }, 750var enricher1 = new Mock<IHttpClientLogEnricher>(); 755var enricher2 = new Mock<IHttpClientLogEnricher>(); 760var enrichers = new List<IHttpClientLogEnricher> { enricher1.Object, enricher2.Object }; 793var enricher1 = new Mock<IHttpClientLogEnricher>(); 799var enricher2 = new Mock<IHttpClientLogEnricher>(); 807new List<IHttpClientLogEnricher> { enricher1.Object, enricher2.Object }, 909new List<IHttpClientLogEnricher> { testEnricher }, 952new HttpClientLogger(fakeLogger, requestReader, Array.Empty<IHttpClientLogEnricher>(), options), 980var logger = new HttpClientLogger(fakeLogger, requestReaderMock.Object, Array.Empty<IHttpClientLogEnricher>(), new()); 1000var logger = new HttpClientLogger(new FakeLogger<HttpClientLogger>(), requestReader, Array.Empty<IHttpClientLogEnricher>(), options);
Logging\HttpClientLoggingExtensionsTest.cs (2)
248var enricherRegistered = provider.GetService<IHttpClientLogEnricher>();