Table of Contents

Class PriorityFilter

Namespace
Microsoft.Practices.EnterpriseLibrary.Logging.Filters
Assembly
Microsoft.Practices.EnterpriseLibrary.Logging.dll

Represents a client-side log filter based on message priority. Messages with priorities between the minimum and maximum values are allowed to be processed, all other messages are dropped.

public class PriorityFilter : LogFilter, ILogFilter
Inheritance
PriorityFilter
Implements
Inherited Members

Constructors

PriorityFilter(string, int)

Initializes a new instance of the PriorityFilter class with a minimum priority and no maximum priority.

public PriorityFilter(string name, int minimumPriority)

Parameters

name string

The name of the instance.

minimumPriority int

The minimum priority value.

PriorityFilter(string, int, int)

Initializes a new instance of the PriorityFilter class with a minimum and maximum priority.

public PriorityFilter(string name, int minimumPriority, int maximumPriority)

Parameters

name string

The name of the instance.

minimumPriority int

The minimum priority value.

maximumPriority int

The maximum priority value.

Properties

MaximumPriority

The maximum value for messages to be processed. If not specified this property defaults to Int32.MaxInt

public int MaximumPriority { get; }

Property Value

int

MinimumPriority

The minimum value for messages to be processed. Messages with a priority below the minimum are dropped immediately on the client.

public int MinimumPriority { get; }

Property Value

int

Methods

Filter(LogEntry)

Tests a log entry to see if its priority is within the allowed limits.

public override bool Filter(LogEntry log)

Parameters

log LogEntry

Log entry to test.

Returns

bool

Returns true if the log entry passes through the category filter.

ShouldLog(int)

Tests a log entry to see if its priority is within the allowed limits.

public bool ShouldLog(int priority)

Parameters

priority int

Priority to test.

Returns

bool

Returns true if the priority passes through the category filter.