ch.qos.logback.core.read
Class CyclicBufferAppender<E>

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.AppenderBase<E>
          extended by ch.qos.logback.core.read.CyclicBufferAppender<E>
All Implemented Interfaces:
Appender<E>, ContextAware, FilterAttachable<E>, LifeCycle

public class CyclicBufferAppender<E>
extends AppenderBase<E>

CyclicBufferAppender stores events in a cyclic buffer of user-specified size. As the name suggests, if the size of the buffer is N, only the latest N events are available.

Author:
Ceki Gulcu

Field Summary
 
Fields inherited from class ch.qos.logback.core.AppenderBase
name, started
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
CyclicBufferAppender()
           
 
Method Summary
protected  void append(E eventObject)
           
 E get(int i)
           
 int getLength()
           
 int getMaxSize()
          Set the size of the cyclic buffer.
 void reset()
           
 void setMaxSize(int maxSize)
           
 void start()
           
 void stop()
           
 
Methods inherited from class ch.qos.logback.core.AppenderBase
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString
 
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, wait, wait, wait
 
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
 

Constructor Detail

CyclicBufferAppender

public CyclicBufferAppender()
Method Detail

start

public void start()
Specified by:
start in interface LifeCycle
Overrides:
start in class AppenderBase<E>

stop

public void stop()
Specified by:
stop in interface LifeCycle
Overrides:
stop in class AppenderBase<E>

append

protected void append(E eventObject)
Specified by:
append in class AppenderBase<E>

getLength

public int getLength()

get

public E get(int i)

reset

public void reset()

getMaxSize

public int getMaxSize()
Set the size of the cyclic buffer.


setMaxSize

public void setMaxSize(int maxSize)


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