Class LevelRangeFilter
This is a simple filter based on Level matching.
public class LevelRangeFilter : FilterSkeleton, IFilter, IOptionHandler
- Inheritance
-
LevelRangeFilter
- Implements
- Inherited Members
Remarks
The filter admits three options LevelMin and LevelMax
that determine the range of priorities that are matched, and
AcceptOnMatch. If there is a match between the range
of priorities and the Level of the LoggingEvent, then the
Decide(LoggingEvent) method returns Accept in case the AcceptOnMatch
option value is set to true, if it is false
then Deny is returned. If there is no match, Deny is returned.
Constructors
LevelRangeFilter()
Default constructor
public LevelRangeFilter()
Properties
AcceptOnMatch
public bool AcceptOnMatch { get; set; }
Property Value
Remarks
The AcceptOnMatch property is a flag that determines the behavior when a matching Level is found. If the flag is set to true then the filter will Accept the logging event, otherwise it will Neutral the event.
The default is true i.e. to Accept the event.
LevelMax
Sets the maximum matched Level
public Level LevelMax { get; set; }
Property Value
Remarks
The maximum level that this filter will attempt to match against the LoggingEvent level. If a match is found then the result depends on the value of AcceptOnMatch.
LevelMin
Set the minimum matched Level
public Level LevelMin { get; set; }
Property Value
Remarks
The minimum level that this filter will attempt to match against the LoggingEvent level. If a match is found then the result depends on the value of AcceptOnMatch.
Methods
Decide(LoggingEvent)
Check if the event should be logged.
public override FilterDecision Decide(LoggingEvent loggingEvent)
Parameters
loggingEventLoggingEventthe logging event to check
Returns
- FilterDecision
see remarks