@Plugin(name="RandomAccessFile", category="Core", elementType="appender", printObject=true) public final class RandomAccessFileAppender extends AbstractOutputStreamAppender<RandomAccessFileManager>
Modifier and Type | Class and Description |
---|---|
static class |
RandomAccessFileAppender.Builder<B extends RandomAccessFileAppender.Builder<B>>
Builds RandomAccessFileAppender instances.
|
LifeCycle.State
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
ELEMENT_TYPE
Modifier and Type | Method and Description |
---|---|
static <B extends RandomAccessFileAppender.Builder<B>> |
createAppender(String fileName,
String append,
String name,
String immediateFlush,
String bufferSizeStr,
String ignore,
Layout<? extends Serializable> layout,
Filter filter,
String advertise,
String advertiseURI,
Configuration configuration)
Deprecated.
Use
newBuilder() . |
int |
getBufferSize()
Returns the size of the file manager's buffer.
|
String |
getFileName()
Returns the file name this appender is associated with.
|
static <B extends RandomAccessFileAppender.Builder<B>> |
newBuilder()
Creates a builder for a RandomAccessFileAppender.
|
boolean |
stop(long timeout,
TimeUnit timeUnit)
Cleanup the Filter.
|
append, directEncodeEvent, getImmediateFlush, getManager, start, stop, writeByteArrayToManager
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
public boolean stop(long timeout, TimeUnit timeUnit)
AbstractFilterable
stop
in interface LifeCycle2
stop
in class AbstractOutputStreamAppender<RandomAccessFileManager>
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argumentpublic String getFileName()
public int getBufferSize()
@Deprecated public static <B extends RandomAccessFileAppender.Builder<B>> RandomAccessFileAppender createAppender(String fileName, String append, String name, String immediateFlush, String bufferSizeStr, String ignore, Layout<? extends Serializable> layout, Filter filter, String advertise, String advertiseURI, Configuration configuration)
newBuilder()
.fileName
- The name and path of the file.append
- "True" if the file should be appended to, "false" if it
should be overwritten. The default is "true".name
- The name of the Appender.immediateFlush
- "true" if the contents should be flushed on every
write, "false" otherwise. The default is "true".bufferSizeStr
- The buffer size, defaults to .ignore
- If "true"
(default) exceptions encountered when appending events are logged; otherwise
they are propagated to the caller.layout
- The layout to use to format the event. If no layout is
provided the default PatternLayout will be used.filter
- The filter, if any, to use.advertise
- "true" if the appender configuration should be
advertised, "false" otherwise.advertiseURI
- The advertised URI which can be used to retrieve the
file contents.configuration
- The Configuration.@PluginBuilderFactory public static <B extends RandomAccessFileAppender.Builder<B>> B newBuilder()
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.