Class TimeBasedRollingPolicy<E>
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.rolling.RollingPolicyBase
-
- ch.qos.logback.core.rolling.TimeBasedRollingPolicy<E>
-
- All Implemented Interfaces:
RollingPolicy
,TriggeringPolicy<E>
,ContextAware
,LifeCycle
- Direct Known Subclasses:
SizeAndTimeBasedRollingPolicy
@Deprecated(since="2022-01-27") public class TimeBasedRollingPolicy<E> extends RollingPolicyBase implements TriggeringPolicy<E>
Deprecated.This internal logback API is not supported by AEM as a Cloud Service.TimeBasedRollingPolicy
is both easy to configure and quite powerful. It allows the roll over to be made based on time. It is possible to specify that the roll over occur once per day, per week or per month.For more information, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy
-
-
Constructor Summary
Constructors Constructor Description TimeBasedRollingPolicy()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
getActiveFileName()
Deprecated.The active log file is determined by the value of the parent's filename option.int
getMaxHistory()
Deprecated.Get the number of archive files to keep.TimeBasedFileNamingAndTriggeringPolicy<E>
getTimeBasedFileNamingAndTriggeringPolicy()
Deprecated.boolean
isCleanHistoryOnStart()
Deprecated.boolean
isTriggeringEvent(java.io.File activeFile, E event)
Deprecated.Should roll-over be triggered at this time?void
rollover()
Deprecated.Rolls over log files according to implementation policy.void
setCleanHistoryOnStart(boolean cleanHistoryOnStart)
Deprecated.Should archive removal be attempted on application start up? Default is false.void
setMaxHistory(int maxHistory)
Deprecated.Set the maximum number of archive files to keep.void
setTimeBasedFileNamingAndTriggeringPolicy(TimeBasedFileNamingAndTriggeringPolicy<E> timeBasedTriggering)
Deprecated.void
setTotalSizeCap(FileSize totalSizeCap)
Deprecated.void
start()
Deprecated.void
stop()
Deprecated.java.lang.String
toString()
Deprecated.-
Methods inherited from class ch.qos.logback.core.rolling.RollingPolicyBase
getCompressionMode, getFileNamePattern, getParentsRawFileProperty, isParentPrudent, isStarted, setFileNamePattern, setParent
-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getStatusManager, setContext
-
-
-
-
Method Detail
-
start
public void start()
Deprecated.- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classRollingPolicyBase
-
stop
public void stop()
Deprecated.- Specified by:
stop
in interfaceLifeCycle
- Overrides:
stop
in classRollingPolicyBase
-
setTimeBasedFileNamingAndTriggeringPolicy
public void setTimeBasedFileNamingAndTriggeringPolicy(TimeBasedFileNamingAndTriggeringPolicy<E> timeBasedTriggering)
Deprecated.
-
getTimeBasedFileNamingAndTriggeringPolicy
public TimeBasedFileNamingAndTriggeringPolicy<E> getTimeBasedFileNamingAndTriggeringPolicy()
Deprecated.
-
rollover
public void rollover() throws RolloverFailure
Deprecated.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
.- Specified by:
rollover
in interfaceRollingPolicy
- Throws:
RolloverFailure
- Thrown if the rollover operation fails for any reason.
-
getActiveFileName
public java.lang.String getActiveFileName()
Deprecated.The active log file is determined by the value of the parent's filename option. However, in case the file name is left blank, then, the active log file equals the file name for the current period as computed by the FileNamePattern option.The RollingPolicy must know whether it is responsible for changing the name of the active file or not. If the active file name is set by the user via the configuration file, then the RollingPolicy must let it like it is. If the user does not specify an active file name, then the RollingPolicy generates one.
To be sure that the file name used by the parent class has been generated by the RollingPolicy and not specified by the user, we keep track of the last generated name object and compare its reference to the parent file name. If they match, then the RollingPolicy knows it's responsible for the change of the file name.
- Specified by:
getActiveFileName
in interfaceRollingPolicy
-
isTriggeringEvent
public boolean isTriggeringEvent(java.io.File activeFile, E event)
Deprecated.Description copied from interface:TriggeringPolicy
Should roll-over be triggered at this time?- Specified by:
isTriggeringEvent
in interfaceTriggeringPolicy<E>
- Parameters:
activeFile
- A reference to the currently active log file.event
- A reference to the currently event.- Returns:
- true if a roll-over should occur.
-
getMaxHistory
public int getMaxHistory()
Deprecated.Get the number of archive files to keep.- Returns:
- number of archive files to keep
-
setMaxHistory
public void setMaxHistory(int maxHistory)
Deprecated.Set the maximum number of archive files to keep.- Parameters:
maxHistory
- number of archive files to keep
-
isCleanHistoryOnStart
public boolean isCleanHistoryOnStart()
Deprecated.
-
setCleanHistoryOnStart
public void setCleanHistoryOnStart(boolean cleanHistoryOnStart)
Deprecated.Should archive removal be attempted on application start up? Default is false.- Parameters:
cleanHistoryOnStart
-- Since:
- 1.0.1
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toString
in classjava.lang.Object
-
setTotalSizeCap
public void setTotalSizeCap(FileSize totalSizeCap)
Deprecated.
-
-