org.apache.logging.log4j.core.appender
Class FastRollingFileAppender<T extends Serializable>

java.lang.Object
  extended by org.apache.logging.log4j.core.filter.AbstractFilterable
      extended by org.apache.logging.log4j.core.appender.AbstractAppender<T>
          extended by org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender<T>
              extended by org.apache.logging.log4j.core.appender.FastRollingFileAppender<T>
Type Parameters:
T - The Layout's Serializable type.
All Implemented Interfaces:
Appender<T>, Filterable, LifeCycle

public final class FastRollingFileAppender<T extends Serializable>
extends AbstractOutputStreamAppender<T>

An appender that writes to random access files and can roll over at intervals.


Field Summary
 
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender
immediateFlush
 
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
LOGGER
 
Method Summary
 void append(LogEvent event)
          Write the log entry rolling over the file when required.
static
<S extends Serializable>
FastRollingFileAppender<S>
createAppender(String fileName, String filePattern, String append, String name, String immediateFlush, TriggeringPolicy policy, RolloverStrategy strategy, Layout<S> layout, Filter filter, String suppress, String advertise, String advertiseURI, Configuration config)
          Create a FastRollingFileAppender.
 String getFileName()
          Returns the File name for the Appender.
 String getFilePattern()
          Returns the file pattern used when rolling over.
 void stop()
          Stop the Appender.
 
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender
getManager, replaceManager, start
 
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
error, error, error, getHandler, getLayout, getName, isExceptionSuppressed, isStarted, parseInt, 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
 

Method Detail

stop

public void stop()
Description copied from class: AbstractAppender
Stop the Appender.

Specified by:
stop in interface LifeCycle
Overrides:
stop in class AbstractOutputStreamAppender<T extends Serializable>

append

public void append(LogEvent event)
Write the log entry rolling over the file when required.

Specified by:
append in interface Appender<T extends Serializable>
Overrides:
append in class AbstractOutputStreamAppender<T extends Serializable>
Parameters:
event - The LogEvent.

getFileName

public String getFileName()
Returns the File name for the Appender.

Returns:
The file name.

getFilePattern

public String getFilePattern()
Returns the file pattern used when rolling over.

Returns:
The file pattern.

createAppender

public static <S extends Serializable> FastRollingFileAppender<S> createAppender(String fileName,
                                                                                 String filePattern,
                                                                                 String append,
                                                                                 String name,
                                                                                 String immediateFlush,
                                                                                 TriggeringPolicy policy,
                                                                                 RolloverStrategy strategy,
                                                                                 Layout<S> layout,
                                                                                 Filter filter,
                                                                                 String suppress,
                                                                                 String advertise,
                                                                                 String advertiseURI,
                                                                                 Configuration config)
Create a FastRollingFileAppender.

Type Parameters:
S - The Layout's Serializable type.
Parameters:
fileName - The name of the file that is actively written to. (required).
filePattern - The pattern of the file name to use on rollover. (required).
append - If true, events are appended to the file. If false, the file is overwritten when opened. Defaults to "true"
name - The name of the Appender (required).
immediateFlush - When true, events are immediately flushed. Defaults to "true".
policy - The triggering policy. (required).
strategy - The rollover strategy. Defaults to DefaultRolloverStrategy.
layout - The layout to use (defaults to the default PatternLayout).
filter - The Filter or null.
suppress - "true" if exceptions should be hidden from the application, "false" otherwise. The default is "true".
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:
A FastRollingFileAppender.


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.