/** * Calls {@link Syncable#sync()} on all appenders in this context. It will always try to call sync on all * appenders event some might failed in between. * * @throws IOException if any appender failed to perform sync. If more than one appender sync failed, * the exception from the first appender failure will be thrown, with the subsequent failures * added as suppressed exception */ @Override public void sync() throws IOException { IOException failure = null; for (Appender<ILoggingEvent> appender : appenders) { if (appender instanceof Syncable) { try { ((Syncable) appender).sync(); } catch (IOException e) { failure = addException(failure, e); } } } if (failure != null) { throw failure; } }
/** * Calls {@link Syncable#sync()} on all appenders in this context. It will always try to call sync on all * appenders event some might failed in between. * * @throws IOException if any appender failed to perform sync. If more than one appender sync failed, * the exception from the first appender failure will be thrown, with the subsequent failures * added as suppressed exception */ @Override public void sync() throws IOException { IOException failure = null; for (Appender<ILoggingEvent> appender : appenders) { if (appender instanceof Syncable) { try { ((Syncable) appender).sync(); } catch (IOException e) { failure = addException(failure, e); } } } if (failure != null) { throw failure; } }
@Override public void sync() throws IOException { flush(); Appender<E> appender = getDelegate(); if (appender instanceof Syncable) { try { ((Syncable) appender).sync(); needSync = false; } catch (Exception e) { needSync = true; throw e; } } } }
@Override public void sync() throws IOException { flush(); Appender<E> appender = getDelegate(); if (appender instanceof Syncable) { try { ((Syncable) appender).sync(); needSync = false; } catch (Exception e) { needSync = true; throw e; } } } }