Package ch.qos.logback.core
Class OutputStreamAppender<E>
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.UnsynchronizedAppenderBase<E>
-
- ch.qos.logback.core.OutputStreamAppender<E>
-
- All Implemented Interfaces:
Appender<E>
,ContextAware
,FilterAttachable<E>
,LifeCycle
- Direct Known Subclasses:
ConsoleAppender
,FileAppender
public class OutputStreamAppender<E> extends UnsynchronizedAppenderBase<E>
OutputStreamAppender appends events to aOutputStream
. 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
-
-
Constructor Summary
Constructors Constructor Description OutputStreamAppender()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Encoder<E>
getEncoder()
OutputStream
getOutputStream()
The underlying output stream used by this appender.boolean
isImmediateFlush()
void
setEncoder(Encoder<E> encoder)
void
setImmediateFlush(boolean immediateFlush)
void
setLayout(Layout<E> layout)
void
setOutputStream(OutputStream 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.-
Methods inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase
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, getStatusManager, setContext
-
Methods inherited from class java.lang.Object
equals, 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
-
-
-
-
Method Detail
-
getOutputStream
public OutputStream getOutputStream()
The underlying output stream used by this appender.- Returns:
-
start
public void start()
Checks that requires parameters are set and if everything is in order, activates this appender.- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classUnsynchronizedAppenderBase<E>
-
stop
public void stop()
Stop this appender instance. The underlying stream or writer is also closed.Stopped appenders cannot be reused.
- Specified by:
stop
in interfaceLifeCycle
- Overrides:
stop
in classUnsynchronizedAppenderBase<E>
-
setOutputStream
public void setOutputStream(OutputStream outputStream)
Sets the @link OutputStream} where the log output will go. The specified
OutputStream
must be opened by the user and be writable. TheOutputStream
will be closed when the appender instance is closed.- Parameters:
outputStream
- An already opened OutputStream.
-
isImmediateFlush
public boolean isImmediateFlush()
-
setImmediateFlush
public void setImmediateFlush(boolean immediateFlush)
-
-