|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.core.filter.AbstractFilterable
org.apache.logging.log4j.core.appender.AbstractAppender
org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender
public abstract class AbstractOutputStreamAppender
Appends log events as bytes to a byte output stream. The stream encoding is defined in the layout.
Field Summary | |
---|---|
protected boolean |
immediateFlush
Immediate flush means that the underlying writer or output stream will be flushed at the end of each append operation. |
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractAppender |
---|
LOGGER |
Constructor Summary | |
---|---|
protected |
AbstractOutputStreamAppender(String name,
Layout layout,
Filter filter,
boolean handleException,
boolean immediateFlush,
OutputStreamManager manager)
Instantiate a WriterAppender and set the output destination to a new OutputStreamWriter initialized with os
as its OutputStream . |
Method Summary | |
---|---|
void |
append(LogEvent event)
Actual writing occurs here. |
protected OutputStreamManager |
getManager()
|
protected void |
replaceManager(OutputStreamManager newManager)
|
void |
start()
Start the Appender. |
void |
stop()
Stop the Appender. |
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender |
---|
close, error, error, error, getHandler, getLayout, getName, isExceptionSuppressed, isStarted, setHandler, toString |
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable |
---|
addFilter, getFilter, hasFilter, isFiltered, removeFilter, startFilter, stopFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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.
Constructor Detail |
---|
protected AbstractOutputStreamAppender(String name, Layout layout, Filter filter, boolean handleException, boolean immediateFlush, OutputStreamManager manager)
OutputStreamWriter
initialized with os
as its OutputStream
.
name
- The name of the Appender.layout
- The layout to format the message.manager
- The OutputStreamManager.Method Detail |
---|
protected OutputStreamManager getManager()
protected void replaceManager(OutputStreamManager 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
public void append(LogEvent event)
Most subclasses of AbstractOutputStreamAppender
will need to
override this method.
event
- The LogEvent.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2013 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.