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
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
stringThe name of the instance.
minimumPriority
intThe minimum priority value.
maximumPriority
intThe 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
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
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
LogEntryLog 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
intPriority to test.
Returns
- bool
Returns true if the priority passes through the category filter.