public class CachingSLF4JAppender extends ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
Modifier and Type | Field and Description |
---|---|
protected int |
currentIndex
The place in the loggingHistory for the next LogRecord.
|
protected ch.qos.logback.classic.PatternLayout |
layout
Pattern layouter used to format log string.
|
protected List<String> |
loggingHistory
The logging cache itself, caching the last "loggingHistorySize" log entries.
|
protected int |
loggingHistorySize
The size of the logging cache.
|
protected List<CachingSLF4JLogRecord> |
loggingMBeans
The log entries exposed as MBeans.
|
protected String |
pattern
Log format string pattern.
|
Constructor and Description |
---|
CachingSLF4JAppender()
Initialize an instance of this class.
|
Modifier and Type | Method and Description |
---|---|
protected void |
append(ch.qos.logback.classic.spi.ILoggingEvent event) |
void |
close()
Close the appender and release associated resources.
|
String |
getNthLogRecord(int n)
Returns the nth logrecord from the top.
|
String |
getPattern()
Returns the pattern used to format the log string.
|
void |
setContext(ch.qos.logback.core.Context context) |
void |
setPattern(String pattern)
Set the pattern used to format the log string.
|
void |
start() |
void |
stop() |
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager
protected ch.qos.logback.classic.PatternLayout layout
protected final int loggingHistorySize
protected final List<String> loggingHistory
protected final List<CachingSLF4JLogRecord> loggingMBeans
protected int currentIndex
public CachingSLF4JAppender()
public String getPattern()
public void setPattern(String pattern)
pattern
- log patternpublic void setContext(ch.qos.logback.core.Context context)
setContext
in interface ch.qos.logback.core.spi.ContextAware
setContext
in class ch.qos.logback.core.spi.ContextAwareBase
public void start()
start
in interface ch.qos.logback.core.spi.LifeCycle
start
in class ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
public void stop()
stop
in interface ch.qos.logback.core.spi.LifeCycle
stop
in class ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
public void close()
protected void append(ch.qos.logback.classic.spi.ILoggingEvent event)
append
in class ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
public String getNthLogRecord(int n)
n
- The number of the log record to getCopyright © 2005–2018 The Royal Danish Library, the National Library of France and the Austrian National Library.. All rights reserved.