| File: Logging\TestHttpLogEnricher.cs | Web Access |
| Project: src\test\Libraries\Microsoft.AspNetCore.Diagnostics.Middleware.Tests\Microsoft.AspNetCore.Diagnostics.Middleware.Tests.csproj (Microsoft.AspNetCore.Diagnostics.Middleware.Tests) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #if NET8_0_OR_GREATER using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Diagnostics.Enrichment; namespace Microsoft.AspNetCore.Diagnostics.Logging.Test; internal sealed class TestHttpLogEnricher : IHttpLogEnricher { internal const string Key1 = "MyEnrichedProperty_1"; internal const string Value1 = "my_value"; internal const string Key2 = "MyEnrichedProperty_2"; internal const double Value2 = 1.75; public void Enrich(IEnrichmentTagCollector collector, HttpContext httpContext) { collector.Add(Key1, Value1); collector.Add(Key2, Value2); } } #endif