TimeBasedRollingPolicy is both easy to configure and quite
powerful. It allows the rollover to be made based on time. It is possible to
specify that the rollover 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
| Modifier and Type | Field and Description |
|---|---|
| private ArchiveRemover | |
| pack-priv boolean | |
| pack-priv Future | |
| pack-priv Future | |
| private Compressor | |
| pack-priv FileNamePattern | |
| pack-priv static final String | |
| private int | |
| private RenameUtil | |
| pack-priv TimeBasedFileNamingAndTriggeringPolicy | |
| protected FileSize |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | getActiveFileName()
Implements ch. |
| public int | |
| public TimeBasedFileNamingAndTriggeringPolicy | |
| public boolean | |
| public boolean | isTriggeringEvent(File
A reference to the currently active log file. activeFile, final E A reference to the current event. event)Implements ch. |
| protected boolean | |
| pack-priv Future | |
| public void | rollover()
Implements ch. |
| public void | setCleanHistoryOnStart(boolean cleanHistoryOnStart)
Should archive removal be attempted on application start up? |
| public void | setMaxHistory(int
number of archive files to keep maxHistory)Set the maximum number of archive files to keep. |
| public void | setTimeBasedFileNamingAndTriggeringPolicy(TimeBasedFileNamingAndTriggeringPolicy<E> timeBasedTriggering)
|
| public void | |
| public void | start()
Overrides ch. Implements ch. |
| public void | stop()
Overrides ch. Implements ch. |
| public String | |
| private String | |
| private void |
| archiveRemover | back to summary |
|---|---|
| private ArchiveRemover archiveRemover | |
| cleanHistoryOnStart | back to summary |
|---|---|
| pack-priv boolean cleanHistoryOnStart | |
| cleanUpFuture | back to summary |
|---|---|
| pack-priv Future<?> cleanUpFuture | |
| compressionFuture | back to summary |
|---|---|
| pack-priv Future<?> compressionFuture | |
| compressor | back to summary |
|---|---|
| private Compressor compressor | |
| fileNamePatternWithoutCompSuffix | back to summary |
|---|---|
| pack-priv FileNamePattern fileNamePatternWithoutCompSuffix | |
| FNP_NOT_SET | back to summary |
|---|---|
| pack-priv static final String FNP_NOT_SET | |
| maxHistory | back to summary |
|---|---|
| private int maxHistory | |
| renameUtil | back to summary |
|---|---|
| private RenameUtil renameUtil | |
| timeBasedFileNamingAndTriggeringPolicy | back to summary |
|---|---|
| pack-priv TimeBasedFileNamingAndTriggeringPolicy<E> timeBasedFileNamingAndTriggeringPolicy | |
| totalSizeCap | back to summary |
|---|---|
| protected FileSize totalSizeCap | |
| TimeBasedRollingPolicy | back to summary |
|---|---|
| public TimeBasedRollingPolicy() | |
| getActiveFileName | back to summary |
|---|---|
| public String getActiveFileName() Implements ch. 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. | |
| getMaxHistory | back to summary |
|---|---|
| public int getMaxHistory() Get the number of archive files to keep.
| |
| getTimeBasedFileNamingAndTriggeringPolicy | back to summary |
|---|---|
| public TimeBasedFileNamingAndTriggeringPolicy | |
| isCleanHistoryOnStart | back to summary |
|---|---|
| public boolean isCleanHistoryOnStart() | |
| isTriggeringEvent | back to summary |
|---|---|
| public boolean isTriggeringEvent(File activeFile, final E event) Implements ch. Delegates to the underlying timeBasedFileNamingAndTriggeringPolicy.
| |
| isUnboundedTotalSizeCap | back to summary |
|---|---|
| protected boolean isUnboundedTotalSizeCap() | |
| renameRawAndAsyncCompress | back to summary |
|---|---|
| pack-priv Future | |
| rollover | back to summary |
|---|---|
| public void rollover() throws RolloverFailure Implements ch. Doc from ch. Rolls over log files according to implementation policy.
This method is invoked by
| |
| setCleanHistoryOnStart | back to summary |
|---|---|
| public void setCleanHistoryOnStart(boolean cleanHistoryOnStart) Should archive removal be attempted on application start up? Default is false.
| |
| setMaxHistory | back to summary |
|---|---|
| public void setMaxHistory(int maxHistory) Set the maximum number of archive files to keep.
| |
| setTimeBasedFileNamingAndTriggeringPolicy | back to summary |
|---|---|
| public void setTimeBasedFileNamingAndTriggeringPolicy(TimeBasedFileNamingAndTriggeringPolicy<E> timeBasedTriggering) | |
| setTotalSizeCap | back to summary |
|---|---|
| public void setTotalSizeCap(FileSize totalSizeCap) | |
| start | back to summary |
|---|---|
| public void start() Overrides ch. Implements ch. | |
| stop | back to summary |
|---|---|
| public void stop() Overrides ch. Implements ch.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| transformFileNamePattern2ZipEntry | back to summary |
|---|---|
| private String transformFileNamePattern2ZipEntry(String fileNamePatternStr) | |
| waitForAsynchronousJobToStop | back to summary |
|---|---|
| private void waitForAsynchronousJobToStop(Future<?> aFuture, String jobDescription) | |