org.apache.logging.log4j.core.appender
Class FastFileAppender<T extends Serializable>
java.lang.Object
org.apache.logging.log4j.core.filter.AbstractFilterable
org.apache.logging.log4j.core.appender.AbstractAppender<T>
org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender<T>
org.apache.logging.log4j.core.appender.FastFileAppender<T>
- Type Parameters:
T
- The Layout
's Serializable
type.
- All Implemented Interfaces:
- Appender<T>, Filterable, LifeCycle
public final class FastFileAppender<T extends Serializable>
- extends AbstractOutputStreamAppender<T>
File Appender.
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender |
error, error, error, getHandler, getLayout, getName, isExceptionSuppressed, isStarted, parseInt, setHandler, toString |
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 this appender is associated with.
- Returns:
- The File name.
createAppender
public static <S extends Serializable> FastFileAppender<S> createAppender(String fileName,
String append,
String name,
String immediateFlush,
String suppress,
Layout<S> layout,
Filter filter,
String advertise,
String advertiseURI,
Configuration config)
- Create a File Appender.
- Type Parameters:
S
- The Layout
's Serializable
type.- 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".suppress
- "true" if exceptions should be hidden from the
application, "false" otherwise. The default is "true".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.
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.