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
public class FixedWindowRollingPolicy extends RollingPolicyBase
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
Fields Modifier and Type Field Description (package private) Compressor
compressor
(package private) static java.lang.String
FNP_NOT_SET
private static int
MAX_WINDOW_SIZE
It's almost always a bad idea to have a large window size, say over 20.(package private) int
maxIndex
(package private) int
minIndex
(package private) static java.lang.String
PRUDENT_MODE_UNSUPPORTED
(package private) static java.lang.String
SEE_PARENT_FN_NOT_SET
(package private) RenameUtil
util
static java.lang.String
ZIP_ENTRY_DATE_PATTERN
-
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 Constructor Description FixedWindowRollingPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getActiveFileName()
Return the value of the parent's RawFile property.int
getMaxIndex()
protected int
getMaxWindowSize()
Subclasses can override this method to increase the max window size, if required.int
getMinIndex()
void
rollover()
Rolls over log files according to implementation policy.void
setMaxIndex(int maxIndex)
void
setMinIndex(int minIndex)
void
start()
private java.lang.String
transformFileNamePatternFromInt2Date(java.lang.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 Detail
-
FNP_NOT_SET
static final java.lang.String FNP_NOT_SET
- See Also:
- Constant Field Values
-
PRUDENT_MODE_UNSUPPORTED
static final java.lang.String PRUDENT_MODE_UNSUPPORTED
- See Also:
- Constant Field Values
-
SEE_PARENT_FN_NOT_SET
static final java.lang.String SEE_PARENT_FN_NOT_SET
- See Also:
- Constant Field Values
-
maxIndex
int maxIndex
-
minIndex
int minIndex
-
util
RenameUtil util
-
compressor
Compressor compressor
-
ZIP_ENTRY_DATE_PATTERN
public static final java.lang.String ZIP_ENTRY_DATE_PATTERN
- See Also:
- Constant Field Values
-
MAX_WINDOW_SIZE
private static int MAX_WINDOW_SIZE
It's almost always a bad idea to have a large window size, say over 20.
-
-
Method Detail
-
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
private java.lang.String transformFileNamePatternFromInt2Date(java.lang.String fileNamePatternStr)
-
rollover
public void rollover() throws RolloverFailure
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
public java.lang.String 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)
-
-