@Override void writeLogItem(String formattedItem) throws IOException { handler.publish(new ExtLogRecord(Level.WARN, formattedItem, SyslogAuditLogHandler.class.getName())); }
@Override void writeLogItem(String formattedItem) throws IOException { boolean reconnect = isReconnect(); if (!reconnect) { handler.publish(new ExtLogRecord(Level.WARN, formattedItem, SyslogAuditLogHandler.class.getName())); errorManager.getAndThrowError(); } else { ControllerLogger.MGMT_OP_LOGGER.attemptingReconnectToSyslog(name, reconnectTimeout); try { // Reinitialise the delegating syslog handler if required, if we're already connected we don't need to // establish a new connection if (!connected) { stop(); initialize(); } handler.publish(new ExtLogRecord(Level.WARN, formattedItem, SyslogAuditLogHandler.class.getName())); errorManager.getAndThrowError(); lastErrorTime = -1; } catch (Exception e) { // A failure has occurred and initialization should be reattempted connected = false; lastErrorTime = System.currentTimeMillis(); errorManager.throwAsIoOrRuntimeException(e); } } }
@Override void writeLogItem(String formattedItem) throws IOException { boolean reconnect = isReconnect(); if (!reconnect) { handler.publish(new ExtLogRecord(Level.WARN, formattedItem, SyslogAuditLogHandler.class.getName())); errorManager.getAndThrowError(); } else { ControllerLogger.MGMT_OP_LOGGER.attemptingReconnectToSyslog(name, reconnectTimeout); try { // Reinitialise the delegating syslog handler if required, if we're already connected we don't need to // establish a new connection if (!connected) { stop(); initialize(); } handler.publish(new ExtLogRecord(Level.WARN, formattedItem, SyslogAuditLogHandler.class.getName())); errorManager.getAndThrowError(); lastErrorTime = -1; } catch (Exception e) { // A failure has occurred and initialization should be reattempted connected = false; lastErrorTime = System.currentTimeMillis(); errorManager.throwAsIoOrRuntimeException(e); } } }