M
- The kind of OutputStreamManager
under managementpublic abstract class AbstractOutputStreamAppender<M extends OutputStreamManager> extends AbstractAppender
Modifier and Type | Field and Description |
---|---|
protected boolean |
immediateFlush
Immediate flush means that the underlying writer or output stream
will be flushed at the end of each append operation.
|
LOGGER
Modifier | Constructor and Description |
---|---|
protected |
AbstractOutputStreamAppender(String name,
Layout<? extends Serializable> layout,
Filter filter,
boolean ignoreExceptions,
boolean immediateFlush,
M manager)
Instantiate 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.
|
M |
getManager()
Gets the manager.
|
protected void |
replaceManager(M newManager) |
void |
start()
Start the Appender.
|
void |
stop()
Stop the Appender.
|
error, error, error, getHandler, getLayout, getName, ignoreExceptions, isStarted, parseInt, setHandler, toString
addFilter, getFilter, hasFilter, isFiltered, removeFilter, startFilter, stopFilter
protected final boolean immediateFlush
immediateFlush
is set to
false
, then there is a good chance that the last few
logs events are not actually written to persistent media if and
when the application crashes.protected AbstractOutputStreamAppender(String name, Layout<? extends Serializable> layout, Filter filter, boolean ignoreExceptions, boolean immediateFlush, M manager)
OutputStreamWriter
initialized with os
as its OutputStream
.name
- The name of the Appender.layout
- The layout to format the message.manager
- The OutputStreamManager.public M getManager()
protected void replaceManager(M newManager)
public void start()
AbstractAppender
start
in interface LifeCycle
start
in class AbstractAppender
public void stop()
AbstractAppender
stop
in interface LifeCycle
stop
in class AbstractAppender
Copyright © 1999-2014 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.