Search in sources :

Example 6 with ErrorStatus

use of ch.qos.logback.core.status.ErrorStatus in project swift by luastar.

the class GuiLoggerAppender method start.

@Override
public void start() {
    int errors = 0;
    if (this.encoder == null) {
        addStatus(new ErrorStatus("No encoder set for the appender named \"" + name + "\".", this));
        errors++;
    }
    // only error free appenders should be activated
    if (errors == 0) {
        super.start();
    }
}
Also used : ErrorStatus(ch.qos.logback.core.status.ErrorStatus)

Example 7 with ErrorStatus

use of ch.qos.logback.core.status.ErrorStatus 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)

Example 8 with ErrorStatus

use of ch.qos.logback.core.status.ErrorStatus in project dropwizard by dropwizard.

the class ResilientOutputStreamBase method postIOFailure.

private void postIOFailure(IOException e) {
    addStatusIfCountNotOverLimit(new ErrorStatus("IO failure while writing to " + getDescription(), this, e));
    presumedClean = false;
    if (recoveryCoordinator == null) {
        recoveryCoordinator = new RecoveryCoordinator();
    }
}
Also used : ErrorStatus(ch.qos.logback.core.status.ErrorStatus) RecoveryCoordinator(ch.qos.logback.core.recovery.RecoveryCoordinator)

Aggregations

ErrorStatus (ch.qos.logback.core.status.ErrorStatus)8 RecoveryCoordinator (ch.qos.logback.core.recovery.RecoveryCoordinator)1 InfoStatus (ch.qos.logback.core.status.InfoStatus)1 WarnStatus (ch.qos.logback.core.status.WarnStatus)1 AmazonClientException (com.amazonaws.AmazonClientException)1 IOException (java.io.IOException)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1