if (appender instanceof Lifecycle && !appender.isStarted()) {
appender.getHandler().error("Attempted to append to non-started appender " + appender.getName());
if (!appender.isExceptionSuppressed()) {
throw new AppenderRuntimeException(
"Attempted to append to non-started appender " + appender.getName());
}
}
if (appender instanceof Filtering && ((Filtering) appender).isFiltered(event)) {
return;
}
try {
appender.append(event);
} catch (RuntimeException ex) {
appender.getHandler().error("An exception occurred processing Appender " + appender.getName(), ex);
if (!appender.isExceptionSuppressed()) {
throw ex;
}
} catch (Exception ex) {
appender.getHandler().error("An exception occurred processing Appender " + appender.getName(), ex);
if (!appender.isExceptionSuppressed()) {
throw new AppenderRuntimeException(ex);
}
}
} finally {
recursive.set(null);
}