Class OutputStreamAppender
java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
org.apache.logging.log4j.core.filter.AbstractFilterable
org.apache.logging.log4j.core.appender.AbstractAppender
org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender<OutputStreamManager>
org.apache.logging.log4j.core.appender.OutputStreamAppender
- All Implemented Interfaces:
Appender
,Filterable
,LocationAware
,LifeCycle
,LifeCycle2
@Plugin(name="OutputStream",
category="Core",
elementType="appender",
printObject=true)
public final class OutputStreamAppender
extends AbstractOutputStreamAppender<OutputStreamManager>
Appends log events to a given output stream using a layout.
Character encoding is handled within the Layout.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builds OutputStreamAppender instances.Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
Fields inherited from interface org.apache.logging.log4j.core.Appender
ELEMENT_TYPE, EMPTY_ARRAY
-
Method Summary
Modifier and TypeMethodDescriptionstatic OutputStreamAppender
createAppender
(Layout<? extends Serializable> layout, Filter filter, OutputStream target, String name, boolean follow, boolean ignore) Creates an OutputStream Appender.static <B extends OutputStreamAppender.Builder<B>>
BMethods inherited from class org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender
append, directEncodeEvent, getImmediateFlush, getManager, start, stop, stop, writeByteArrayToManager
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializable, toString
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter
Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
-
Method Details
-
createAppender
@PluginFactory public static OutputStreamAppender createAppender(Layout<? extends Serializable> layout, Filter filter, OutputStream target, String name, boolean follow, boolean ignore) Creates an OutputStream Appender.- Parameters:
layout
- The layout to use or null to get the default layout.filter
- The Filter or null.target
- an output stream.follow
- If true will follow changes to the underlying output stream. Use false as the default.name
- The name of the Appender (required).ignore
- If"true"
(default) exceptions encountered when appending events are logged; otherwise they are propagated to the caller. Use true as the default.- Returns:
- The ConsoleAppender.
-
newBuilder
-