public final class RollingRandomAccessFileAppender extends AbstractOutputStreamAppender
immediateFlush
LOGGER
Modifier and Type | Method and Description |
---|---|
void |
append(LogEvent event)
Write the log entry rolling over the file when required.
|
static RollingRandomAccessFileAppender |
createAppender(String fileName,
String filePattern,
String append,
String name,
String immediateFlush,
TriggeringPolicy policy,
RolloverStrategy strategy,
Layout<? extends Serializable> layout,
Filter filter,
String ignore,
String advertise,
String advertiseURI,
Configuration config)
Create a RollingRandomAccessFileAppender.
|
String |
getFileName()
Returns the File name for the Appender.
|
String |
getFilePattern()
Returns the file pattern used when rolling over.
|
void |
stop()
Stop the Appender.
|
getManager, replaceManager, start
error, error, error, getHandler, getLayout, getName, ignoreExceptions, isStarted, parseInt, setHandler, toString
addFilter, getFilter, hasFilter, isFiltered, removeFilter, startFilter, stopFilter
public void stop()
AbstractAppender
stop
in interface LifeCycle
stop
in class AbstractOutputStreamAppender
public void append(LogEvent event)
append
in interface Appender
append
in class AbstractOutputStreamAppender
event
- The LogEvent.public String getFileName()
public String getFilePattern()
public static RollingRandomAccessFileAppender createAppender(String fileName, String filePattern, String append, String name, String immediateFlush, TriggeringPolicy policy, RolloverStrategy strategy, Layout<? extends Serializable> layout, Filter filter, String ignore, String advertise, String advertiseURI, Configuration config)
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.ignore
- If "true"
(default) exceptions encountered when appending events are logged; otherwise
they are propagated to the caller.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.Copyright © 1999-2014 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.