Class FailureSummaryLoggingAppenderListener<Event extends DeferredProcessingAware>
java.lang.Object
net.logstash.logback.appender.listener.FailureSummaryAppenderListener<Event>
net.logstash.logback.appender.listener.FailureSummaryLoggingAppenderListener<Event>
- All Implemented Interfaces:
AppenderListener<Event>
,TcpAppenderListener<Event>
public class FailureSummaryLoggingAppenderListener<Event extends DeferredProcessingAware>
extends FailureSummaryAppenderListener<Event>
A
TcpAppenderListener
that logs a warning message on the first
append/send/connect success after a series of consecutive failures.
The warning message includes the number of consecutive failures,
the timestamp of the first failure,
and the duration between the first and last failures.
The default logger to which the event is sent is the fully qualified name of FailureSummaryLoggingAppenderListener
,
and can be changed by calling setLoggerName(String)
.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.logstash.logback.appender.listener.FailureSummaryAppenderListener
FailureSummaryAppenderListener.CallbackType, FailureSummaryAppenderListener.FailureSummary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
handleFailureSummary
(FailureSummaryAppenderListener.FailureSummary failureSummary, FailureSummaryAppenderListener.CallbackType callbackType) Logs a message with the details from the givenFailureSummaryAppenderListener.FailureSummary
with the given callback type.void
setLoggerName
(String loggerName) Sets the slf4j logger name to which to log.Methods inherited from class net.logstash.logback.appender.listener.FailureSummaryAppenderListener
connectionFailed, connectionOpened, eventAppended, eventAppendFailed, eventSendFailure, eventSent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.logstash.logback.appender.listener.AppenderListener
appenderStarted, appenderStopped
Methods inherited from interface net.logstash.logback.appender.listener.TcpAppenderListener
connectionClosed
-
Constructor Details
-
FailureSummaryLoggingAppenderListener
public FailureSummaryLoggingAppenderListener()
-
-
Method Details
-
handleFailureSummary
protected void handleFailureSummary(FailureSummaryAppenderListener.FailureSummary failureSummary, FailureSummaryAppenderListener.CallbackType callbackType) Logs a message with the details from the givenFailureSummaryAppenderListener.FailureSummary
with the given callback type.- Specified by:
handleFailureSummary
in classFailureSummaryAppenderListener<Event extends DeferredProcessingAware>
- Parameters:
failureSummary
- contains summary details of all the consecutive failurescallbackType
- the type of failure (append/send/connect)
-
getLoggerName
-
setLoggerName
Sets the slf4j logger name to which to log. Defaults to the fully qualified name ofFailureSummaryLoggingAppenderListener
.- Parameters:
loggerName
- the name of the logger to which to log.
-