org.mockserver.logging.DelayedFileCreationRollingFileAppender Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockserver-logging Show documentation
Show all versions of mockserver-logging Show documentation
Extensions to Logback to improve MockServer logging behaviour
package org.mockserver.logging;
import ch.qos.logback.core.rolling.RollingFileAppender;
/**
* @author jamesdbloom
*/
public class DelayedFileCreationRollingFileAppender extends RollingFileAppender {
private boolean fileCreated = false;
@Override
public void start() {
started = true;
}
@Override
protected void subAppend(E event) {
if (!fileCreated) {
super.start();
fileCreated = true;
}
super.subAppend(event);
}
}