Appender, Filterable, LifeCycle, LifeCycle2@Plugin(name="MemoryMappedFile", category="Core", elementType="appender", printObject=true) public final class MemoryMappedFileAppender extends AbstractOutputStreamAppender<MemoryMappedFileManager>
| Modifier and Type | Class | Description |
|---|---|---|
static class |
MemoryMappedFileAppender.Builder<B extends MemoryMappedFileAppender.Builder<B>> |
Builds RandomAccessFileAppender instances.
|
LifeCycle.StateDEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGERELEMENT_TYPE| Modifier and Type | Method | Description |
|---|---|---|
void |
append(LogEvent event) |
Write the log entry rolling over the file when required.
|
static <B extends MemoryMappedFileAppender.Builder<B>> |
createAppender(String fileName,
String append,
String name,
String immediateFlush,
String regionLengthStr,
String ignore,
Layout<? extends Serializable> layout,
Filter filter,
String advertise,
String advertiseURI,
Configuration config) |
Deprecated.
Use
newBuilder(). |
String |
getFileName() |
Returns the file name this appender is associated with.
|
int |
getRegionLength() |
Returns the length of the memory mapped region.
|
static <B extends MemoryMappedFileAppender.Builder<B>> |
newBuilder() |
|
boolean |
stop(long timeout,
TimeUnit timeUnit) |
Cleanup the Filter.
|
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, setHandler, toStringaddFilter, getFilter, hasFilter, isFiltered, removeFilterequalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stopdirectEncodeEvent, getImmediateFlush, getManager, start, stop, writeByteArrayToManagerpublic boolean stop(long timeout,
TimeUnit timeUnit)
AbstractFilterablestop in interface LifeCycle2stop in class AbstractOutputStreamAppender<MemoryMappedFileManager>timeout - the maximum time to waittimeUnit - the time unit of the timeout argumentpublic void append(LogEvent event)
append in interface Appenderappend in class AbstractOutputStreamAppender<MemoryMappedFileManager>event - The LogEvent.public String getFileName()
public int getRegionLength()
@Deprecated public static <B extends MemoryMappedFileAppender.Builder<B>> MemoryMappedFileAppender createAppender(String fileName, String append, String name, String immediateFlush, String regionLengthStr, String ignore, Layout<? extends Serializable> layout, Filter filter, String advertise, String advertiseURI, Configuration config)
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
"false".regionLengthStr - 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.config - The Configuration.@PluginBuilderFactory public static <B extends MemoryMappedFileAppender.Builder<B>> B newBuilder()
Copyright © 1999-2018. 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.