Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.logging.log4j.core.appender
Class MemoryMappedFileAppender

    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<MemoryMappedFileManager>
                      org.apache.logging.log4j.core.appender.MemoryMappedFileAppender

All Implemented Interfaces:
  Serializable, Appender, Filterable, LifeCycle

    @Plugin(name="MemoryMappedFile",
            category="Core",
            elementType="appender",
            printObject=true)
    public final class MemoryMappedFileAppender

extends AbstractOutputStreamAppender<MemoryMappedFileManager>

Memory Mapped File Appender.

Since:
  2.1
See Also:
  Serialized Form

Nested Class Summary

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.appender.AbstractOutputStreamAppender
`immediateFlush`

Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
`LOGGER`

Method Summary
`void` | `append(LogEvent event)` Write the log entry rolling over the file when required.
`static 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)` Create a Memory Mapped File Appender.
`String` | `getFileName()` Returns the file name this appender is associated with.
`int` | `getRegionLength()` Returns the length of the memory mapped region.
`void` | `stop()` Cleanup the Filter.

Methods inherited from class org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender
`getManager, start`

Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
`error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, setHandler, toString`

Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable
`addFilter, getFilter, hasFilter, isFiltered, removeFilter`

Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
`equalsImpl, getState, hashCodeImpl, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.apache.logging.log4j.core.LifeCycle
`getState, isStarted, isStopped`

Method Detail

### stop

    public void stop()

  Description copied from class: `AbstractFilterable`
  Cleanup the Filter.

  Specified by:
    `stop` in interface `LifeCycle`
  Overrides:
    `stop` in class `AbstractOutputStreamAppender<MemoryMappedFileManager>`

### append

    public void append(LogEvent event)

  Write the log entry rolling over the file when required.

  Specified by:
    `append` in interface `Appender`
  Overrides:
    `append` in class `AbstractOutputStreamAppender<MemoryMappedFileManager>`
  Parameters:
    `event` - The LogEvent.

### getFileName

    public String getFileName()

  Returns the file name this appender is associated with.

  Returns:
    The File name.

### getRegionLength

    public int getRegionLength()

  Returns the length of the memory mapped region.

  Returns:
    the length of the memory mapped region

### createAppender

    @PluginFactory
    public static MemoryMappedFileAppender createAppender(@PluginAttribute(value="fileName")
                                                                        String fileName,
                                                                        @PluginAttribute(value="append")
                                                                        String append,
                                                                        @PluginAttribute(value="name")
                                                                        String name,
                                                                        @PluginAttribute(value="immediateFlush")
                                                                        String immediateFlush,
                                                                        @PluginAttribute(value="regionLength")
                                                                        String regionLengthStr,
                                                                        @PluginAttribute(value="ignoreExceptions")
                                                                        String ignore,
                                                                        @PluginElement(value="Layout")
                                                                        Layout<? extends Serializable> layout,
                                                                        @PluginElement(value="Filter")
                                                                        Filter filter,
                                                                        @PluginAttribute(value="advertise")
                                                                        String advertise,
                                                                        @PluginAttribute(value="advertiseURI")
                                                                        String advertiseURI,
                                                                        @PluginConfiguration
                                                                        Configuration config)

  Create a Memory Mapped File Appender.

  Parameters:
    `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".
    `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.
  Returns:
    The FileAppender.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2015 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.