LoggingRedactionExtensions.EnableRedaction Method

Definition

Overloads

EnableRedaction(ILoggingBuilder)

Enables redaction functionality within the logging infrastructure.

EnableRedaction(ILoggingBuilder, IConfigurationSection)

Enables redaction functionality within the logging infrastructure.

EnableRedaction(ILoggingBuilder, Action<LoggerRedactionOptions>)

Enables redaction functionality within the logging infrastructure.

EnableRedaction(ILoggingBuilder)

Source:
LoggingRedactionExtensions.cs

Enables redaction functionality within the logging infrastructure.

public static Microsoft.Extensions.Logging.ILoggingBuilder EnableRedaction (this Microsoft.Extensions.Logging.ILoggingBuilder builder);

Parameters

builder
ILoggingBuilder

The dependency injection container to add logging to.

Returns

The value of builder.

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 6 (package-provided), 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)

EnableRedaction(ILoggingBuilder, IConfigurationSection)

Source:
LoggingRedactionExtensions.cs

Enables redaction functionality within the logging infrastructure.

public static Microsoft.Extensions.Logging.ILoggingBuilder EnableRedaction (this Microsoft.Extensions.Logging.ILoggingBuilder builder, Microsoft.Extensions.Configuration.IConfigurationSection section);

Parameters

builder
ILoggingBuilder

The dependency injection container to add logging to.

section
IConfigurationSection

Configuration section that contains LoggerRedactionOptions.

Returns

The value of builder.

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 6 (package-provided), 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)

EnableRedaction(ILoggingBuilder, Action<LoggerRedactionOptions>)

Source:
LoggingRedactionExtensions.cs

Enables redaction functionality within the logging infrastructure.

public static Microsoft.Extensions.Logging.ILoggingBuilder EnableRedaction (this Microsoft.Extensions.Logging.ILoggingBuilder builder, Action<Microsoft.Extensions.Logging.LoggerRedactionOptions> configure);

Parameters

builder
ILoggingBuilder

The dependency injection container to add logging to.

configure
Action<LoggerRedactionOptions>

Delegate the fine-tune the options.

Returns

The value of builder.

Applies to

.NET 9 (package-provided) en andere versies
Product Versies
.NET 6 (package-provided), 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)