Class FailureSummaryAppenderListener<Event extends DeferredProcessingAware>
java.lang.Object
net.logstash.logback.appender.listener.FailureSummaryAppenderListener<Event>
- All Implemented Interfaces:
AppenderListener<Event>
,TcpAppenderListener<Event>
- Direct Known Subclasses:
FailureSummaryLoggingAppenderListener
public abstract class FailureSummaryAppenderListener<Event extends DeferredProcessingAware>
extends Object
implements TcpAppenderListener<Event>
A
TcpAppenderListener
that invokes different callbacks for
the first successful append/send/connect after a series of failures.
The callback includes a summary of the failures that occurred.
Subclasses implement handleFailureSummary(FailureSummary, CallbackType)
to define behavior when the first successful append/send/connect
occurs after a series of consecutive failures.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The type of listener callback.static interface
Summary details of consecutive failures -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
connectionFailed
(Appender<Event> appender, InetSocketAddress address, Throwable reason) Called after the given appender fails to open a socketvoid
connectionOpened
(Appender<Event> appender, Socket socket) Called after the given appender successfully opens the given socketvoid
eventAppended
(Appender<Event> appender, Event event, long durationInNanos) Called when the given event was successfully appended by the given appender.void
eventAppendFailed
(Appender<Event> appender, Event event, Throwable reason) Called when the given event was failed to be appended by the given appender.void
eventSendFailure
(Appender<Event> appender, Event event, Throwable reason) Called when the given appender fails to send the given event over a TCP connection.void
Called after given appender successfully sent the given event over the TCP connection.protected abstract void
handleFailureSummary
(FailureSummaryAppenderListener.FailureSummary failureSummary, FailureSummaryAppenderListener.CallbackType callbackType) Called after the first success after the a series of consecutive failures.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
-
FailureSummaryAppenderListener
public FailureSummaryAppenderListener()
-
-
Method Details
-
eventAppended
Description copied from interface:AppenderListener
Called when the given event was successfully appended by the given appender. Note that for Asynchronous appenders, this generally means that the event was accepted for processing, but hasn't finished processing yet.- Specified by:
eventAppended
in interfaceAppenderListener<Event extends DeferredProcessingAware>
- Parameters:
appender
- the appender when successfully appended the eventevent
- the event that was appendeddurationInNanos
- the time (in nanoseconds) it took to append the event
-
eventAppendFailed
Description copied from interface:AppenderListener
Called when the given event was failed to be appended by the given appender.- Specified by:
eventAppendFailed
in interfaceAppenderListener<Event extends DeferredProcessingAware>
- Parameters:
appender
- the appender when successfully appended the eventevent
- the event that was appendedreason
- what caused the failure
-
eventSent
Description copied from interface:TcpAppenderListener
Called after given appender successfully sent the given event over the TCP connection.- Specified by:
eventSent
in interfaceTcpAppenderListener<Event extends DeferredProcessingAware>
- Parameters:
appender
- the appender that sent the eventsocket
- the socket over which the appender sent the eventevent
- the event that was sentdurationInNanos
- the time (in nanoseconds) it took to send the event
-
eventSendFailure
Description copied from interface:TcpAppenderListener
Called when the given appender fails to send the given event over a TCP connection.- Specified by:
eventSendFailure
in interfaceTcpAppenderListener<Event extends DeferredProcessingAware>
- Parameters:
appender
- the appender that attempted to send the eventevent
- the event that failed to sendreason
- what caused the failure
-
connectionOpened
Description copied from interface:TcpAppenderListener
Called after the given appender successfully opens the given socket- Specified by:
connectionOpened
in interfaceTcpAppenderListener<Event extends DeferredProcessingAware>
- Parameters:
appender
- the appender that opened the socketsocket
- the socket that was opened
-
connectionFailed
Description copied from interface:TcpAppenderListener
Called after the given appender fails to open a socket- Specified by:
connectionFailed
in interfaceTcpAppenderListener<Event extends DeferredProcessingAware>
- Parameters:
appender
- the appender that attempted to open a socketaddress
- the address to which the appender attempted to connectreason
- what caused the failure
-
handleFailureSummary
protected abstract void handleFailureSummary(FailureSummaryAppenderListener.FailureSummary failureSummary, FailureSummaryAppenderListener.CallbackType callbackType) Called after the first success after the a series of consecutive failures.- Parameters:
failureSummary
- contains summary details of all the consecutive failurescallbackType
- the type of callback (append/send/connect)
-