public class OutputStreamAppender<E> extends UnsynchronizedAppenderBase<E>
OutputStream. This class provides basic services that other appenders build upon. For more information about this appender, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#OutputStreamAppender
| Modifier and Type | Field and Description |
|---|---|
protected Encoder |
encoder
It is the encoder which is ultimately responsible for writing the event to an
OutputStream.
|
protected ReentrantLock |
lock
All synchronization in this class is done via the lock object.
|
name, startedcontext| Constructor and Description |
|---|
OutputStreamAppender()
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
append(E eventObject)
|
protected void |
closeOutputStream()
Close the underlying
OutputStream.
|
Encoder |
getEncoder()
|
OutputStream |
getOutputStream()
The underlying output stream used by this appender.
|
void |
setEncoder(Encoder
|
void |
setLayout(Layout
|
void |
setOutputStream(OutputStream
Sets the @link OutputStream} where the log output will go.
|
void |
start()
Checks that requires parameters are set and if everything is in order, activates this appender.
|
void |
stop()
Stop this appender instance.
|
protected void |
subAppend(E event)
Actual writing occurs here.
|
protected void |
writeOut(E event)
|
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toStringaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContextprotected Encoder<E> encoder
OutputStream.
protected final ReentrantLocklock
public OutputStreamgetOutputStream()
public void start()
protected void append(E eventObject)
public void stop()
Stopped appenders cannot be reused.
protected void closeOutputStream()
OutputStream.
public void setOutputStream(OutputStreamoutputStream)
Sets the @link OutputStream} where the log output will go. The specified OutputStream must be opened by the user and be writable. The OutputStream will be closed when the appender instance is closed.
outputStream - An already opened OutputStream.
protected void writeOut(E event) throws IOException
IOException
protected void subAppend(E event)
Most subclasses of WriterAppender will need to override this method.