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 Stringprivate static intIt'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) RenameUtilstatic final StringFields inherited from class ch.qos.logback.core.rolling.RollingPolicyBase
compressionMode, fileNamePattern, fileNamePatternStr, zipEntryFileNamePatternFields 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.intprotected intSubclasses can override this method to increase the max window size, if required.intvoidrollover()Rolls over log files according to implementation policy.voidsetMaxIndex(int maxIndex) voidsetMinIndex(int minIndex) voidstart()private StringtransformFileNamePatternFromInt2Date(String fileNamePatternStr) Methods inherited from class ch.qos.logback.core.rolling.RollingPolicyBase
determineCompressionMode, getCompressionMode, getFileNamePattern, getParentsRawFileProperty, isParentPrudent, isStarted, setFileNamePattern, setParent, stopMethods 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:
startin interfaceLifeCycle- Overrides:
startin 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:RollingPolicyRolls 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)
-