ch.qos.logback.core.filter
Class Filter<E>

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.filter.Filter<E>
All Implemented Interfaces:
ContextAware, LifeCycle
Direct Known Subclasses:
AbstractMatcherFilter, ThresholdFilter

public abstract class Filter<E>
extends ContextAwareBase
implements LifeCycle

Users should extend this class to implement customized event filtering.

We suggest that you first try to use the built-in rules before rushing to write your own custom filters.

For more information about filters, please refer to the online manual at http://logback.qos.ch/manual/filters.html

Author:
Ceki Gülcü

Field Summary
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
Filter()
           
 
Method Summary
abstract  FilterReply decide(E event)
          If the decision is #DENY, then the event will be dropped.
 String getName()
           
 boolean isStarted()
           
 void setName(String name)
           
 void start()
           
 void stop()
           
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Filter

public Filter()
Method Detail

start

public void start()
Specified by:
start in interface LifeCycle

isStarted

public boolean isStarted()
Specified by:
isStarted in interface LifeCycle

stop

public void stop()
Specified by:
stop in interface LifeCycle

decide

public abstract FilterReply decide(E event)
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.

Parameters:
event - The event to decide upon.

getName

public String getName()

setName

public void setName(String name)


Copyright © 2005-2011 QOS.ch. All Rights Reserved.