Search in sources :

Example 1 with InfoStatus

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));
    }
}
Also used : InfoStatus(ch.qos.logback.core.status.InfoStatus)

Example 2 with InfoStatus

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));
    }
}
Also used : InfoStatus(ch.qos.logback.core.status.InfoStatus)

Example 3 with InfoStatus

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));
    }
}
Also used : InfoStatus(ch.qos.logback.core.status.InfoStatus) ErrorStatus(ch.qos.logback.core.status.ErrorStatus) IOException(java.io.IOException)

Aggregations

InfoStatus (ch.qos.logback.core.status.InfoStatus)3 ErrorStatus (ch.qos.logback.core.status.ErrorStatus)1 IOException (java.io.IOException)1