Class AbstractLogstashTcpSocketAppender<Event extends DeferredProcessingAware,Listener extends TcpAppenderListener<Event>>

java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.UnsynchronizedAppenderBase<Event>
net.logstash.logback.appender.AsyncDisruptorAppender<Event,Listener>
net.logstash.logback.appender.AbstractLogstashTcpSocketAppender<Event,Listener>
All Implemented Interfaces:
Appender<Event>, ContextAware, FilterAttachable<Event>, LifeCycle
Direct Known Subclasses:
LogstashAccessTcpSocketAppender, LogstashTcpSocketAppender

public abstract class AbstractLogstashTcpSocketAppender<Event extends DeferredProcessingAware,Listener extends TcpAppenderListener<Event>> extends AsyncDisruptorAppender<Event,Listener>
An AsyncDisruptorAppender appender that writes events to a TCP Socket outputStream.

The behavior is similar to a SocketAppender, except that:

  • it uses a RingBuffer instead of a BlockingQueue
  • it writes using an Encoder instead of serialization

In addition, SSL can be enabled by setting the SSL configuration via setSsl(SSLConfiguration). See the logback manual for details on how to configure client-side SSL.

Since:
11 Jun 2014 (creation date)
Author:
Mirko Bernardoni (original, which did not use disruptor)
  • Field Details

    • HOST_NAME_FORMAT

      protected static final String HOST_NAME_FORMAT
      See Also:
    • PORT_FORMAT

      protected static final String PORT_FORMAT
      See Also:
    • DEFAULT_THREAD_NAME_FORMAT

      public static final String DEFAULT_THREAD_NAME_FORMAT
      See Also:
    • DEFAULT_PORT

      public static final int DEFAULT_PORT
      The default port number of remote logging server (4560).
      See Also:
    • DEFAULT_RECONNECTION_DELAY

      public static final int DEFAULT_RECONNECTION_DELAY
      The default reconnection delay (30000 milliseconds or 30 seconds).
      See Also:
    • DEFAULT_WRITE_TIMEOUT

      public static final int DEFAULT_WRITE_TIMEOUT
      The default write timeout in milliseconds (0 means no write timeout).
      See Also:
    • DEFAULT_INITIALSEND_DELAY

      public static final int DEFAULT_INITIALSEND_DELAY
      The default delay before sending data into a newly established connection
      See Also:
    • DEFAULT_QUEUE_SIZE

      @Deprecated public static final int DEFAULT_QUEUE_SIZE
      Default size of the queue used to hold logging events that are destined for the remote peer. Assuming an average log entry to take 1k, this would result in the application using about 10MB additional memory if the queue is full
      See Also:
    • DEFAULT_CONNECTION_TIMEOUT

      public static final int DEFAULT_CONNECTION_TIMEOUT
      Default timeout when waiting for the remote server to accept our connection. The same timeout is used as a read timeout during SSL handshake.
      See Also:
    • DEFAULT_WRITE_BUFFER_SIZE

      public static final int DEFAULT_WRITE_BUFFER_SIZE
      See Also:
  • Constructor Details

    • AbstractLogstashTcpSocketAppender

      public AbstractLogstashTcpSocketAppender()
  • Method Details