Logback API
Version 0.9.8

ch.qos.logback.core
Class AppenderBase<E>

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.AppenderBase<E>
All Implemented Interfaces:
Appender<E>, ContextAware, FilterAttachable, LifeCycle
Direct Known Subclasses:
CyclicBufferAppender, DBAppenderBase, JMSAppenderBase, ListAppender, SMTPAppenderBase, SocketAppenderBase, SyslogAppenderBase, TelnetAppender, WriterAppender

public abstract class AppenderBase<E>
extends ContextAwareBase
implements Appender<E>, FilterAttachable

This class is used to manage base functionnalities of all appenders. For more information about this appender, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#AppenderBase

Author:
Ceki Gülcü

Field Summary
protected  String name
          Appenders are named.
protected  boolean started
           
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
AppenderBase()
           
 
Method Summary
 void addFilter(Filter newFilter)
          Add a filter.
protected abstract  void append(E eventObject)
           
 void clearAllFilters()
           
 void doAppend(E eventObject)
          This is where an appender accomplishes its work.
 FilterReply getFilterChainDecision(Object event)
          Loop through the filters in the chain.
 Filter getFirstFilter()
          Get first filter in the chain.
 Layout<E> getLayout()
          Returns this appenders layout.
 String getName()
          Get the name of this appender.
 boolean isStarted()
           
 void setLayout(Layout<E> layout)
          Set the Layout for this appender.
 void setName(String name)
          Set the name of this appender.
 void start()
           
 void stop()
           
 String toString()
           
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
 

Field Detail

started

protected boolean started

name

protected String name
Appenders are named.

Constructor Detail

AppenderBase

public AppenderBase()
Method Detail

getName

public String getName()
Description copied from interface: Appender
Get the name of this appender. The name uniquely identifies the appender.

Specified by:
getName in interface Appender<E>

doAppend

public void doAppend(E eventObject)
Description copied from interface: Appender
This is where an appender accomplishes its work. Note that the argument is of type Object.

Specified by:
doAppend in interface Appender<E>

append

protected abstract void append(E eventObject)

setName

public void setName(String name)
Set the name of this appender.

Specified by:
setName in interface Appender<E>

start

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

stop

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

isStarted

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

toString

public String toString()
Overrides:
toString in class Object

addFilter

public void addFilter(Filter newFilter)
Description copied from interface: FilterAttachable
Add a filter.

Specified by:
addFilter in interface FilterAttachable

getFirstFilter

public Filter getFirstFilter()
Description copied from interface: FilterAttachable
Get first filter in the chain.

Specified by:
getFirstFilter in interface FilterAttachable

clearAllFilters

public void clearAllFilters()
Specified by:
clearAllFilters in interface FilterAttachable

getFilterChainDecision

public FilterReply getFilterChainDecision(Object event)
Description copied from interface: FilterAttachable
Loop through the filters in the chain. As soon as a filter decides on ACCEPT or DENY, then that value is returned. If all of the filters return NEUTRAL, then NEUTRAL is returned.

Specified by:
getFilterChainDecision in interface FilterAttachable

getLayout

public Layout<E> getLayout()
Description copied from interface: Appender
Returns this appenders layout.

Specified by:
getLayout in interface Appender<E>

setLayout

public void setLayout(Layout<E> layout)
Description copied from interface: Appender
Set the Layout for this appender.

Specified by:
setLayout in interface Appender<E>

Logback API
Version 0.9.8

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