FilterLoggingBuilderExtensions.AddFilter Method

Definition

Overloads

AddFilter(ILoggingBuilder, Func<LogLevel,Boolean>)

Adds a log filter to the factory.

AddFilter(LoggerFilterOptions, String, Func<LogLevel,Boolean>)

Adds a log filter to the factory.

AddFilter(ILoggingBuilder, String, Func<LogLevel,Boolean>)

Adds a log filter to the factory.

AddFilter(ILoggingBuilder, String, LogLevel)

Adds a log filter to the factory.

AddFilter(LoggerFilterOptions, Func<String,String,LogLevel,Boolean>)

Adds a log filter to the factory.

AddFilter(LoggerFilterOptions, String, LogLevel)

Adds a log filter to the factory.

AddFilter(LoggerFilterOptions, Func<LogLevel,Boolean>)

Adds a log filter to the factory.

AddFilter(ILoggingBuilder, Func<String,String,LogLevel,Boolean>)

Adds a log filter to the factory.

AddFilter(ILoggingBuilder, Func<String,LogLevel,Boolean>)

Adds a log filter to the factory.

AddFilter(LoggerFilterOptions, Func<String,LogLevel,Boolean>)

Adds a log filter to the factory.

AddFilter<T>(LoggerFilterOptions, String, LogLevel)

Adds a log filter for the given ILoggerProvider.

AddFilter<T>(ILoggingBuilder, Func<LogLevel,Boolean>)

Adds a log filter for the given ILoggerProvider.

AddFilter<T>(ILoggingBuilder, Func<String,LogLevel,Boolean>)

Adds a log filter for the given ILoggerProvider.

AddFilter<T>(LoggerFilterOptions, Func<LogLevel,Boolean>)

Adds a log filter for the given ILoggerProvider.

AddFilter<T>(LoggerFilterOptions, Func<String,LogLevel,Boolean>)

Adds a log filter for the given ILoggerProvider.

AddFilter<T>(ILoggingBuilder, String, LogLevel)

Adds a log filter for the given ILoggerProvider.

AddFilter<T>(ILoggingBuilder, String, Func<LogLevel,Boolean>)

Adds a log filter for the given ILoggerProvider.

AddFilter<T>(LoggerFilterOptions, String, Func<LogLevel,Boolean>)

Adds a log filter for the given ILoggerProvider.

AddFilter(ILoggingBuilder, Func<LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter to the factory.

public static Microsoft.Extensions.Logging.ILoggingBuilder AddFilter (this Microsoft.Extensions.Logging.ILoggingBuilder builder, Func<Microsoft.Extensions.Logging.LogLevel,bool> levelFilter);

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to add the filter to.

levelFilter
Func<LogLevel,Boolean>

The filter to be added.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter(LoggerFilterOptions, String, Func<LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter to the factory.

public static Microsoft.Extensions.Logging.LoggerFilterOptions AddFilter (this Microsoft.Extensions.Logging.LoggerFilterOptions builder, string? category, Func<Microsoft.Extensions.Logging.LogLevel,bool> levelFilter);

Parameters

builder
LoggerFilterOptions

The LoggerFilterOptions to add the filter to.

category
String

The category to filter.

levelFilter
Func<LogLevel,Boolean>

The filter function to apply.

Returns

The LoggerFilterOptions so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter(ILoggingBuilder, String, Func<LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter to the factory.

public static Microsoft.Extensions.Logging.ILoggingBuilder AddFilter (this Microsoft.Extensions.Logging.ILoggingBuilder builder, string? category, Func<Microsoft.Extensions.Logging.LogLevel,bool> levelFilter);

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to add the filter to.

category
String

The category to filter.

levelFilter
Func<LogLevel,Boolean>

The filter function to apply.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter(ILoggingBuilder, String, LogLevel)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter to the factory.

public static Microsoft.Extensions.Logging.ILoggingBuilder AddFilter (this Microsoft.Extensions.Logging.ILoggingBuilder builder, string? category, Microsoft.Extensions.Logging.LogLevel level);

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to add the filter to.

category
String

The category to filter.

level
LogLevel

The level to filter.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter(LoggerFilterOptions, Func<String,String,LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter to the factory.

public static Microsoft.Extensions.Logging.LoggerFilterOptions AddFilter (this Microsoft.Extensions.Logging.LoggerFilterOptions builder, Func<string?,string?,Microsoft.Extensions.Logging.LogLevel,bool> filter);

Parameters

builder
LoggerFilterOptions

The ILoggingBuilder to add the filter to.

filter
Func<String,String,LogLevel,Boolean>

The filter function to apply.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter(LoggerFilterOptions, String, LogLevel)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter to the factory.

public static Microsoft.Extensions.Logging.LoggerFilterOptions AddFilter (this Microsoft.Extensions.Logging.LoggerFilterOptions builder, string? category, Microsoft.Extensions.Logging.LogLevel level);

Parameters

builder
LoggerFilterOptions

The LoggerFilterOptions to add the filter to.

category
String

The category to filter.

level
LogLevel

The level to filter.

Returns

The LoggerFilterOptions so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter(LoggerFilterOptions, Func<LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter to the factory.

public static Microsoft.Extensions.Logging.LoggerFilterOptions AddFilter (this Microsoft.Extensions.Logging.LoggerFilterOptions builder, Func<Microsoft.Extensions.Logging.LogLevel,bool> levelFilter);

Parameters

builder
LoggerFilterOptions

The LoggerFilterOptions to add the filter to.

levelFilter
Func<LogLevel,Boolean>

The filter function to apply.

Returns

The LoggerFilterOptions so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter(ILoggingBuilder, Func<String,String,LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter to the factory.

public static Microsoft.Extensions.Logging.ILoggingBuilder AddFilter (this Microsoft.Extensions.Logging.ILoggingBuilder builder, Func<string?,string?,Microsoft.Extensions.Logging.LogLevel,bool> filter);

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to add the filter to.

filter
Func<String,String,LogLevel,Boolean>

The filter to be added.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter(ILoggingBuilder, Func<String,LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter to the factory.

public static Microsoft.Extensions.Logging.ILoggingBuilder AddFilter (this Microsoft.Extensions.Logging.ILoggingBuilder builder, Func<string?,Microsoft.Extensions.Logging.LogLevel,bool> categoryLevelFilter);

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to add the filter to.

categoryLevelFilter
Func<String,LogLevel,Boolean>

The filter to be added.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter(LoggerFilterOptions, Func<String,LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter to the factory.

public static Microsoft.Extensions.Logging.LoggerFilterOptions AddFilter (this Microsoft.Extensions.Logging.LoggerFilterOptions builder, Func<string?,Microsoft.Extensions.Logging.LogLevel,bool> categoryLevelFilter);

Parameters

builder
LoggerFilterOptions

The LoggerFilterOptions to add the filter to.

categoryLevelFilter
Func<String,LogLevel,Boolean>

The filter function to apply.

Returns

The LoggerFilterOptions so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter<T>(LoggerFilterOptions, String, LogLevel)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter for the given ILoggerProvider.

public static Microsoft.Extensions.Logging.LoggerFilterOptions AddFilter<T> (this Microsoft.Extensions.Logging.LoggerFilterOptions builder, string? category, Microsoft.Extensions.Logging.LogLevel level) where T : Microsoft.Extensions.Logging.ILoggerProvider;

Type Parameters

T

The ILoggerProvider which this filter will be added for.

Parameters

builder
LoggerFilterOptions

The LoggerFilterOptions to add the filter to.

category
String

The category to filter.

level
LogLevel

The level to filter.

Returns

The LoggerFilterOptions so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter<T>(ILoggingBuilder, Func<LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter for the given ILoggerProvider.

public static Microsoft.Extensions.Logging.ILoggingBuilder AddFilter<T> (this Microsoft.Extensions.Logging.ILoggingBuilder builder, Func<Microsoft.Extensions.Logging.LogLevel,bool> levelFilter) where T : Microsoft.Extensions.Logging.ILoggerProvider;

Type Parameters

T

The ILoggerProvider which this filter will be added for.

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to add the filter to.

levelFilter
Func<LogLevel,Boolean>

The filter to be added.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter<T>(ILoggingBuilder, Func<String,LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter for the given ILoggerProvider.

public static Microsoft.Extensions.Logging.ILoggingBuilder AddFilter<T> (this Microsoft.Extensions.Logging.ILoggingBuilder builder, Func<string?,Microsoft.Extensions.Logging.LogLevel,bool> categoryLevelFilter) where T : Microsoft.Extensions.Logging.ILoggerProvider;

Type Parameters

T

The ILoggerProvider which this filter will be added for.

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to add the filter to.

categoryLevelFilter
Func<String,LogLevel,Boolean>

The filter to be added.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter<T>(LoggerFilterOptions, Func<LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter for the given ILoggerProvider.

public static Microsoft.Extensions.Logging.LoggerFilterOptions AddFilter<T> (this Microsoft.Extensions.Logging.LoggerFilterOptions builder, Func<Microsoft.Extensions.Logging.LogLevel,bool> levelFilter) where T : Microsoft.Extensions.Logging.ILoggerProvider;

Type Parameters

T

The ILoggerProvider which this filter will be added for.

Parameters

builder
LoggerFilterOptions

The LoggerFilterOptions to add the filter to.

levelFilter
Func<LogLevel,Boolean>

The filter function to apply.

Returns

The LoggerFilterOptions so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter<T>(LoggerFilterOptions, Func<String,LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter for the given ILoggerProvider.

public static Microsoft.Extensions.Logging.LoggerFilterOptions AddFilter<T> (this Microsoft.Extensions.Logging.LoggerFilterOptions builder, Func<string?,Microsoft.Extensions.Logging.LogLevel,bool> categoryLevelFilter) where T : Microsoft.Extensions.Logging.ILoggerProvider;

Type Parameters

T

The ILoggerProvider which this filter will be added for.

Parameters

builder
LoggerFilterOptions

The LoggerFilterOptions to add the filter to.

categoryLevelFilter
Func<String,LogLevel,Boolean>

The filter function to apply.

Returns

The LoggerFilterOptions so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter<T>(ILoggingBuilder, String, LogLevel)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter for the given ILoggerProvider.

public static Microsoft.Extensions.Logging.ILoggingBuilder AddFilter<T> (this Microsoft.Extensions.Logging.ILoggingBuilder builder, string? category, Microsoft.Extensions.Logging.LogLevel level) where T : Microsoft.Extensions.Logging.ILoggerProvider;

Type Parameters

T

The ILoggerProvider which this filter will be added for.

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to add the filter to.

category
String

The category to filter.

level
LogLevel

The level to filter.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter<T>(ILoggingBuilder, String, Func<LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter for the given ILoggerProvider.

public static Microsoft.Extensions.Logging.ILoggingBuilder AddFilter<T> (this Microsoft.Extensions.Logging.ILoggingBuilder builder, string? category, Func<Microsoft.Extensions.Logging.LogLevel,bool> levelFilter) where T : Microsoft.Extensions.Logging.ILoggerProvider;

Type Parameters

T

The ILoggerProvider which this filter will be added for.

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to add the filter to.

category
String

The category to filter.

levelFilter
Func<LogLevel,Boolean>

The filter function to apply.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)

AddFilter<T>(LoggerFilterOptions, String, Func<LogLevel,Boolean>)

Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs
Source:
FilterLoggingBuilderExtensions.cs

Adds a log filter for the given ILoggerProvider.

public static Microsoft.Extensions.Logging.LoggerFilterOptions AddFilter<T> (this Microsoft.Extensions.Logging.LoggerFilterOptions builder, string? category, Func<Microsoft.Extensions.Logging.LogLevel,bool> levelFilter) where T : Microsoft.Extensions.Logging.ILoggerProvider;

Type Parameters

T

The ILoggerProvider which this filter will be added for.

Parameters

builder
LoggerFilterOptions

The ILoggingBuilder to add the filter to.

category
String

The category to filter.

levelFilter
Func<LogLevel,Boolean>

The filter function to apply.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) и другие версии
Продукт Версии
.NET 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)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)