ch.qos.logback.core.filter
Class EvaluatorFilter<E>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.filter.Filter<E>
ch.qos.logback.core.filter.AbstractMatcherFilter<E>
ch.qos.logback.core.filter.EvaluatorFilter<E>
- All Implemented Interfaces:
- ContextAware, LifeCycle
public class EvaluatorFilter<E>
- extends AbstractMatcherFilter<E>
The value of the AbstractMatcherFilter.onMatch
and AbstractMatcherFilter.onMismatch
attributes is set
to Filter.NEUTRAL
, so that a badly configured evaluator filter does
not disturb the functioning of the filter chain.
It is expected that one of the two attributes will have its value changed
to Filter.ACCEPT
or Filter.DENY
. That way, it is possible to
decide if a given result must be returned after the evaluation either failed
or succeeded.
For more information about filters, please refer to the online manual at
http://logback.qos.ch/manual/filters.html
- Author:
- Ceki Gülcü, Sébastien Pennec
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EvaluatorFilter
public EvaluatorFilter()
start
public void start()
- Specified by:
start
in interface LifeCycle
- Overrides:
start
in class Filter<E>
getEvaluator
public EventEvaluator<E> getEvaluator()
setEvaluator
public void setEvaluator(EventEvaluator<E> evaluator)
decide
public FilterReply decide(E event)
- Description copied from class:
Filter
- If the decision is
#DENY
, then the event will be
dropped. If the decision is #NEUTRAL
, then the next
filter, if any, will be invoked. If the decision is
#ACCEPT
then the event will be logged without
consulting with other filters in the chain.
- Specified by:
decide
in class Filter<E>
- Parameters:
event
- The event to decide upon.