Class RollingPolicyBase
java.lang.Object
org.apache.log4j.rolling.RollingPolicyBase
- All Implemented Interfaces:
RollingPolicy, org.apache.log4j.spi.OptionHandler
- Direct Known Subclasses:
FixedWindowRollingPolicy, TimeBasedRollingPolicy
public abstract class RollingPolicyBase
extends Object
implements RollingPolicy, org.apache.log4j.spi.OptionHandler
Implements methods common to most, it not all, rolling
policies. Currently such methods are limited to a compression mode
getter/setter.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringActive file name may be null.private StringFile name pattern.private static final StringError message.private org.apache.log4j.pattern.PatternConverter[]File name pattern converters.private ExtrasFormattingInfo[]File name field specifiers.private static final StringReference for error message. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected final voidformatFileName(Object obj, StringBuffer buf) Format file name.Deprecated.Duplicates FileAppender.file and should be removedprotected final org.apache.log4j.pattern.PatternConverterGet file name pattern.protected final org.apache.log4j.pattern.PatternConverterprotected final voidParse file name pattern.voidsetActiveFileName(String afn) Deprecated.Duplicates FileAppender.file and should be removedvoidsetFileNamePattern(String fnp) Set file name pattern.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RollingPolicy
initialize, rollover
-
Field Details
-
FNP_NOT_SET
-
SEE_FNP_NOT_SET
-
patternConverters
private org.apache.log4j.pattern.PatternConverter[] patternConvertersFile name pattern converters. -
patternFields
File name field specifiers. -
fileNamePatternStr
File name pattern. -
activeFileName
Active file name may be null. Duplicates FileAppender.file and should be removed.
-
-
Constructor Details
-
RollingPolicyBase
public RollingPolicyBase()
-
-
Method Details
-
activateOptions
public void activateOptions()- Specified by:
activateOptionsin interfaceorg.apache.log4j.spi.OptionHandler
-
setFileNamePattern
Set file name pattern.- Parameters:
fnp- file name pattern.
-
getFileNamePattern
-
setActiveFileName
Deprecated.Duplicates FileAppender.file and should be removedActiveFileName can be left unset, i.e. as null.- Parameters:
afn- active file name.
-
getActiveFileName
Deprecated.Duplicates FileAppender.file and should be removedReturn the value of the ActiveFile option.- Returns:
- active file name.
-
parseFileNamePattern
protected final void parseFileNamePattern()Parse file name pattern. -
formatFileName
Format file name.- Parameters:
obj- object to be evaluted in formatting, may not be null.buf- string buffer to which formatted file name is appended, may not be null.
-
getDatePatternConverter
protected final org.apache.log4j.pattern.PatternConverter getDatePatternConverter() -
getIntegerPatternConverter
protected final org.apache.log4j.pattern.PatternConverter getIntegerPatternConverter()
-