use of ch.qos.logback.core.status.InfoStatus in project dropwizard by dropwizard.
the class ResilientOutputStreamBase method addStatusIfCountNotOverLimit.
private void addStatusIfCountNotOverLimit(Status s) {
++statusCount;
if (statusCount < STATUS_COUNT_LIMIT) {
addStatus(s);
}
if (statusCount == STATUS_COUNT_LIMIT) {
addStatus(s);
addStatus(new InfoStatus("Will supress future messages regarding " + getDescription(), this));
}
}
use of ch.qos.logback.core.status.InfoStatus in project dropwizard by dropwizard.
the class ResilientOutputStreamBase method postSuccessfulWrite.
private void postSuccessfulWrite() {
if (recoveryCoordinator != null) {
recoveryCoordinator = null;
statusCount = 0;
addStatus(new InfoStatus("Recovered from IO failure on " + getDescription(), this));
}
}
use of ch.qos.logback.core.status.InfoStatus in project dropwizard by dropwizard.
the class ResilientOutputStreamBase method attemptRecovery.
private void attemptRecovery() {
try {
close();
} catch (IOException e) {
// Ignored
}
addStatusIfCountNotOverLimit(new InfoStatus("Attempting to recover from IO failure on " + getDescription(), this));
// subsequent writes must always be in append mode
try {
os = openNewOutputStream();
presumedClean = true;
} catch (IOException e) {
addStatusIfCountNotOverLimit(new ErrorStatus("Failed to open " + getDescription(), this, e));
}
}
Aggregations