All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ch.qos.logback.core.rolling.RollingPolicy Maven / Gradle / Ivy

There is a newer version: 2.12.15
Show newest version
/**
 * Logback: the reliable, generic, fast and flexible logging framework.
 * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
 *
 * This program and the accompanying materials are dual-licensed under
 * either the terms of the Eclipse Public License v1.0 as published by
 * the Eclipse Foundation
 *
 *   or (per the licensee's choosing)
 *
 * under the terms of the GNU Lesser General Public License version 2.1
 * as published by the Free Software Foundation.
 */
package ch.qos.logback.core.rolling;

import ch.qos.logback.core.FileAppender;
import ch.qos.logback.core.rolling.helper.CompressionMode;
import ch.qos.logback.core.spi.LifeCycle;

/**
 * A RollingPolicy is responsible for performing the rolling over
 * of the active log file. The RollingPolicy is also responsible
 * for providing the active log file, that is the live file where
 * logging output will be directed.
 * 
 * @author Ceki Gülcü
 */
public interface RollingPolicy extends LifeCycle {

    /**
     * Rolls over log files according to implementation policy.
     * 
     * 

This method is invoked by {@link RollingFileAppender}, usually at the * behest of its {@link TriggeringPolicy}. * * @throws RolloverFailure * Thrown if the rollover operation fails for any reason. */ void rollover() throws RolloverFailure; /** * Get the name of the active log file. * *

With implementations such as {@link TimeBasedRollingPolicy}, this * method returns a new file name, where the actual output will be sent. * *

On other implementations, this method might return the FileAppender's * file property. */ String getActiveFileName(); /** * The compression mode for this policy. * * @return */ CompressionMode getCompressionMode(); /** * This method allows RollingPolicy implementations to be aware of their * containing appender. * * @param appender */ void setParent(FileAppender appender); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy