Package ch.qos.logback.core.rolling
Class FixedWindowRollingPolicy
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.rolling.RollingPolicyBase
ch.qos.logback.core.rolling.FixedWindowRollingPolicy
- All Implemented Interfaces:
RollingPolicy
,ContextAware
,LifeCycle
When rolling over,
FixedWindowRollingPolicy
renames files
according to a fixed window algorithm.
For more information about this policy, please refer to the online manual at
http://logback.qos.ch/manual/appenders.html#FixedWindowRollingPolicy-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Compressor
(package private) static final String
private static int
It's almost always a bad idea to have a large window size, say over 20.(package private) int
(package private) int
(package private) static final String
(package private) static final String
(package private) RenameUtil
static final String
Fields inherited from class ch.qos.logback.core.rolling.RollingPolicyBase
compressionMode, fileNamePattern, fileNamePatternStr, zipEntryFileNamePattern
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the value of the parent's RawFile property.int
protected int
Subclasses can override this method to increase the max window size, if required.int
void
rollover()
Rolls over log files according to implementation policy.void
setMaxIndex
(int maxIndex) void
setMinIndex
(int minIndex) void
start()
private String
transformFileNamePatternFromInt2Date
(String fileNamePatternStr) Methods inherited from class ch.qos.logback.core.rolling.RollingPolicyBase
determineCompressionMode, getCompressionMode, getFileNamePattern, getParentsRawFileProperty, isParentPrudent, isStarted, setFileNamePattern, setParent, stop
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
Field Details
-
FNP_NOT_SET
- See Also:
-
PRUDENT_MODE_UNSUPPORTED
- See Also:
-
SEE_PARENT_FN_NOT_SET
- See Also:
-
maxIndex
int maxIndex -
minIndex
int minIndex -
util
RenameUtil util -
compressor
Compressor compressor -
ZIP_ENTRY_DATE_PATTERN
- See Also:
-
MAX_WINDOW_SIZE
private static int MAX_WINDOW_SIZEIt's almost always a bad idea to have a large window size, say over 20.
-
-
Constructor Details
-
FixedWindowRollingPolicy
public FixedWindowRollingPolicy()
-
-
Method Details
-
start
public void start()- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classRollingPolicyBase
-
getMaxWindowSize
protected int getMaxWindowSize()Subclasses can override this method to increase the max window size, if required. This is to address LOGBACK-266.- Returns:
-
transformFileNamePatternFromInt2Date
-
rollover
Description copied from interface:RollingPolicy
Rolls over log files according to implementation policy.This method is invoked by
RollingFileAppender
, usually at the behest of itsTriggeringPolicy
.- Throws:
RolloverFailure
- Thrown if the rollover operation fails for any reason.
-
getActiveFileName
Return the value of the parent's RawFile property. -
getMaxIndex
public int getMaxIndex() -
getMinIndex
public int getMinIndex() -
setMaxIndex
public void setMaxIndex(int maxIndex) -
setMinIndex
public void setMinIndex(int minIndex)
-