
fr.manastria.logback.StartupTimeBasedTriggeringPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jUtilities Show documentation
Show all versions of jUtilities Show documentation
Tools for programming in JAVA.
package fr.manastria.logback;
import ch.qos.logback.core.joran.spi.NoAutoStart;
import ch.qos.logback.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy;
import ch.qos.logback.core.rolling.RolloverFailure;
// Source : http://stackoverflow.com/questions/2492022/how-to-roll-the-log-file-on-startup-in-logback
/**
* Allows rotation of the log files for each run
*
*
* @author jpdemory
*
* @param : TODO
*/
@NoAutoStart
public class StartupTimeBasedTriggeringPolicy extends
DefaultTimeBasedFileNamingAndTriggeringPolicy {
/**
* TODO
*/
@Override
public void start() {
super.start();
nextCheck = 0L;
isTriggeringEvent(null, null);
try {
tbrp.rollover();
} catch (RolloverFailure e) {
//Do nothing
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy