Class PropertyFilter
Simple filter to match a string an event property
public class PropertyFilter : StringMatchFilter, IFilter, IOptionHandler
- Inheritance
-
PropertyFilter
- Implements
- Derived
- Inherited Members
Remarks
Simple filter to match a string in the value for a specific event property
Constructors
PropertyFilter()
Default constructor
public PropertyFilter()
Properties
Key
The key to lookup in the event properties and then match against.
public string Key { get; set; }
Property Value
Remarks
The key name to use to lookup in the properties map of the LoggingEvent. The match will be performed against the value of this property if it exists.
Methods
Decide(LoggingEvent)
Check if this filter should allow the event to be logged
public override FilterDecision Decide(LoggingEvent loggingEvent)
Parameters
loggingEventLoggingEventthe event being logged
Returns
- FilterDecision
see remarks
Remarks
The event property for the Key is matched against the StringToMatch. If the StringToMatch occurs as a substring within the property value then a match will have occurred. If no match occurs this function will return Neutral allowing other filters to check the event. If a match occurs then the value of AcceptOnMatch is checked. If it is true then Accept is returned otherwise Deny is returned.