Module logstash.logback.encoder
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 enumThe type of listener callback.static interfaceSummary details of consecutive failures -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconnectionFailed(Appender<Event> appender, InetSocketAddress address, Throwable reason) Called after the given appender fails to open a socketvoidconnectionOpened(Appender<Event> appender, Socket socket) Called after the given appender successfully opens the given socketvoideventAppended(Appender<Event> appender, Event event, long durationInNanos) Called when the given event was successfully appended by the given appender.voideventAppendFailed(Appender<Event> appender, Event event, Throwable reason) Called when the given event was failed to be appended by the given appender.voideventSendFailure(Appender<Event> appender, Event event, Throwable reason) Called when the given appender fails to send the given event over a TCP connection.voidCalled after given appender successfully sent the given event over the TCP connection.protected abstract voidhandleFailureSummary(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, waitMethods inherited from interface net.logstash.logback.appender.listener.AppenderListener
appenderStarted, appenderStoppedMethods inherited from interface net.logstash.logback.appender.listener.TcpAppenderListener
connectionClosed
-
Constructor Details
-
FailureSummaryAppenderListener
public FailureSummaryAppenderListener()
-
-
Method Details
-
eventAppended
Description copied from interface:AppenderListenerCalled 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:
eventAppendedin 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:AppenderListenerCalled when the given event was failed to be appended by the given appender.- Specified by:
eventAppendFailedin 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:TcpAppenderListenerCalled after given appender successfully sent the given event over the TCP connection.- Specified by:
eventSentin 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:TcpAppenderListenerCalled when the given appender fails to send the given event over a TCP connection.- Specified by:
eventSendFailurein 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:TcpAppenderListenerCalled after the given appender successfully opens the given socket- Specified by:
connectionOpenedin interfaceTcpAppenderListener<Event extends DeferredProcessingAware>- Parameters:
appender- the appender that opened the socketsocket- the socket that was opened
-
connectionFailed
Description copied from interface:TcpAppenderListenerCalled after the given appender fails to open a socket- Specified by:
connectionFailedin 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)
-