Package ch.qos.logback.core.rolling
Class RollingPolicyBase
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.rolling.RollingPolicyBase
-
- All Implemented Interfaces:
RollingPolicy,ContextAware,LifeCycle
- Direct Known Subclasses:
FixedWindowRollingPolicy,TimeBasedRollingPolicy
public abstract class RollingPolicyBase extends ContextAwareBase implements RollingPolicy
Implements methods common to most, it not all, rolling policies. Currently such methods are limited to a compression mode getter/setter.
-
-
Field Summary
Fields Modifier and Type Field Description protected CompressionModecompressionMode(package private) FileNamePatternfileNamePatternprotected java.lang.StringfileNamePatternStrprivate FileAppender<?>parentprivate booleanstarted(package private) FileNamePatternzipEntryFileNamePattern-
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
-
Constructor Summary
Constructors Constructor Description RollingPolicyBase()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddetermineCompressionMode()Given the FileNamePattern string, this method determines the compression mode depending on last letters of the fileNamePatternStr.CompressionModegetCompressionMode()The compression mode for this policy.java.lang.StringgetFileNamePattern()java.lang.StringgetParentsRawFileProperty()booleanisParentPrudent()booleanisStarted()voidsetFileNamePattern(java.lang.String fnp)voidsetParent(FileAppender<?> appender)This method allows RollingPolicy implementations to be aware of their containing appender.voidstart()voidstop()-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ch.qos.logback.core.rolling.RollingPolicy
getActiveFileName, rollover
-
-
-
-
Field Detail
-
compressionMode
protected CompressionMode compressionMode
-
fileNamePattern
FileNamePattern fileNamePattern
-
fileNamePatternStr
protected java.lang.String fileNamePatternStr
-
parent
private FileAppender<?> parent
-
zipEntryFileNamePattern
FileNamePattern zipEntryFileNamePattern
-
started
private boolean started
-
-
Method Detail
-
determineCompressionMode
protected void determineCompressionMode()
Given the FileNamePattern string, this method determines the compression mode depending on last letters of the fileNamePatternStr. Patterns ending with .gz imply GZIP compression, endings with '.zip' imply ZIP compression. Otherwise and by default, there is no compression.
-
setFileNamePattern
public void setFileNamePattern(java.lang.String fnp)
-
getFileNamePattern
public java.lang.String getFileNamePattern()
-
getCompressionMode
public CompressionMode getCompressionMode()
Description copied from interface:RollingPolicyThe compression mode for this policy.- Specified by:
getCompressionModein interfaceRollingPolicy- Returns:
-
setParent
public void setParent(FileAppender<?> appender)
Description copied from interface:RollingPolicyThis method allows RollingPolicy implementations to be aware of their containing appender.- Specified by:
setParentin interfaceRollingPolicy
-
isParentPrudent
public boolean isParentPrudent()
-
getParentsRawFileProperty
public java.lang.String getParentsRawFileProperty()
-
-