| File: Logging\LoggerConfig.cs | Web Access |
| Project: src\src\Libraries\Microsoft.Extensions.Telemetry\Microsoft.Extensions.Telemetry.csproj (Microsoft.Extensions.Telemetry) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections.Generic; using Microsoft.Extensions.Compliance.Classification; using Microsoft.Extensions.Compliance.Redaction; #if NET9_0_OR_GREATER using Microsoft.Extensions.Diagnostics.Buffering; #endif using Microsoft.Extensions.Diagnostics.Enrichment; namespace Microsoft.Extensions.Logging; internal sealed class LoggerConfig { public LoggerConfig( KeyValuePair<string, object?>[] staticTags, Action<IEnrichmentTagCollector>[] enrichers, LoggingSampler? sampler, bool captureStackTraces, bool useFileInfoForStackTraces, bool includeExceptionMessage, int maxStackTraceLength, Func<DataClassificationSet, Redactor> getRedactor, #if NET9_0_OR_GREATER bool addRedactionDiscriminator, LogBuffer? logBuffer) #else bool addRedactionDiscriminator) #endif { StaticTags = staticTags; Enrichers = enrichers; Sampler = sampler; CaptureStackTraces = captureStackTraces; UseFileInfoForStackTraces = useFileInfoForStackTraces; MaxStackTraceLength = maxStackTraceLength; IncludeExceptionMessage = includeExceptionMessage; GetRedactor = getRedactor; AddRedactionDiscriminator = addRedactionDiscriminator; #if NET9_0_OR_GREATER LogBuffer = logBuffer; #endif } public KeyValuePair<string, object?>[] StaticTags { get; } public Action<IEnrichmentTagCollector>[] Enrichers { get; } public LoggingSampler? Sampler { get; } public bool CaptureStackTraces { get; } public bool UseFileInfoForStackTraces { get; } public bool IncludeExceptionMessage { get; } public int MaxStackTraceLength { get; } public Func<DataClassificationSet, Redactor> GetRedactor { get; } public bool AddRedactionDiscriminator { get; } #if NET9_0_OR_GREATER public LogBuffer? LogBuffer { get; } #endif }