M
- The kind of OutputStreamManager
under managementpublic abstract class AbstractOutputStreamAppender<M extends OutputStreamManager> extends AbstractAppender
Modifier and Type | Class and Description |
---|---|
static class |
AbstractOutputStreamAppender.Builder<B extends AbstractOutputStreamAppender.Builder<B>>
Subclasses can extend this abstract Builder.
|
LifeCycle.State
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
ELEMENT_TYPE
Modifier | Constructor and Description |
---|---|
protected |
AbstractOutputStreamAppender(String name,
Layout<? extends Serializable> layout,
Filter filter,
boolean ignoreExceptions,
boolean immediateFlush,
M manager)
|
protected |
AbstractOutputStreamAppender(String name,
Layout<? extends Serializable> layout,
Filter filter,
boolean ignoreExceptions,
boolean immediateFlush,
Property[] properties,
M manager)
Instantiates a WriterAppender and set the output destination to a new
OutputStreamWriter
initialized with os as its OutputStream . |
Modifier and Type | Method and Description |
---|---|
void |
append(LogEvent event)
Actual writing occurs here.
|
protected void |
directEncodeEvent(LogEvent event) |
boolean |
getImmediateFlush()
Gets the immediate flush setting.
|
M |
getManager()
Gets the manager.
|
void |
start()
Make the Filter available for use.
|
boolean |
stop(long timeout,
TimeUnit timeUnit)
Cleanup the Filter.
|
protected boolean |
stop(long timeout,
TimeUnit timeUnit,
boolean changeLifeCycleState)
Cleanup the Filter.
|
protected void |
writeByteArrayToManager(LogEvent event) |
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializable, toString
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
@Deprecated protected AbstractOutputStreamAppender(String name, Layout<? extends Serializable> layout, Filter filter, boolean ignoreExceptions, boolean immediateFlush, M manager)
AbstractOutputStreamAppender(String, Layout, Filter, boolean, boolean, Property[], OutputStreamManager)
OutputStreamWriter
initialized with os
as its OutputStream
.name
- The name of the Appender.layout
- The layout to format the message.manager
- The OutputStreamManager.protected AbstractOutputStreamAppender(String name, Layout<? extends Serializable> layout, Filter filter, boolean ignoreExceptions, boolean immediateFlush, Property[] properties, M manager)
OutputStreamWriter
initialized with os
as its OutputStream
.name
- The name of the Appender.layout
- The layout to format the message.properties
- optional propertiesmanager
- The OutputStreamManager.public boolean getImmediateFlush()
public M getManager()
public void start()
AbstractFilterable
start
in interface LifeCycle
start
in class AbstractFilterable
public boolean stop(long timeout, TimeUnit timeUnit)
AbstractFilterable
stop
in interface LifeCycle2
stop
in class AbstractFilterable
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argumentprotected boolean stop(long timeout, TimeUnit timeUnit, boolean changeLifeCycleState)
AbstractFilterable
stop
in class AbstractFilterable
public void append(LogEvent event)
Most subclasses of AbstractOutputStreamAppender
will need to override this method.
event
- The LogEvent.protected void directEncodeEvent(LogEvent event)
protected void writeByteArrayToManager(LogEvent event)
Copyright © 1999-2020 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.