Package org.apache.log4j.rule
Interface Rule
-
- All Known Implementing Classes:
AbstractRule
,AndRule
,ColorRule
,EqualsRule
,ExistsRule
,ExpressionRule
,InequalityRule
,LevelEqualsRule
,LevelInequalityRule.GreaterThanEqualsRule
,LevelInequalityRule.GreaterThanRule
,LevelInequalityRule.LessThanEqualsRule
,LevelInequalityRule.LessThanRule
,LikeRule
,NotEqualsRule
,NotLevelEqualsRule
,NotRule
,OrRule
,PartialTextMatchRule
,TimestampEqualsRule
,TimestampInequalityRule
public interface Rule
A Rule evaluates to true of false given a LoggingEvent object, and can notify listeners when the underlying implementation of this Rule has it's criteria changed by using the standard PropertyChangeListener infrastructure.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this instance, which is notified when underlying Rule information has changed.boolean
evaluate(org.apache.log4j.spi.LoggingEvent e, java.util.Map matches)
Returns true if this implementation of the rule accepts the LoggingEvent, or false if not.void
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a known PropertyChangeListener from this Rule.
-
-
-
Method Detail
-
evaluate
boolean evaluate(org.apache.log4j.spi.LoggingEvent e, java.util.Map matches)
Returns true if this implementation of the rule accepts the LoggingEvent, or false if not.What True/False means can be client-specific.
- Parameters:
e
- LoggingEvent this instance will evaluatematches
- a Map of event field keys to Sets of matching strings (may be null) which will be updated during execution of this method to include field and string matches based on the rule evaluation results- Returns:
- true if this Rule instance accepts the event, otherwise false.
-
addPropertyChangeListener
void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this instance, which is notified when underlying Rule information has changed. (there are no specific property name events).- Parameters:
listener
- listener
-
removePropertyChangeListener
void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a known PropertyChangeListener from this Rule.- Parameters:
listener
- listener
-
-