I would like to configure logback to do the following.
I got the following to work (combining ideas from previous answers). Note I was dealing with size-based files, not time-based, but I am guessing the same solution works.
public class StartupSizeBasedTriggeringPolicy extends ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy {
private final AtomicReference isFirstTime = new AtomicReference(true);
@Override
public boolean isTriggeringEvent(final File activeFile, final E event) {
//this method appears to have side-effects so always call
boolean result = super.isTriggeringEvent(activeFile, event);
return isFirstTime.compareAndSet(true, false) || result;
}
}