Class TcpSocketAppenderFactory<E extends ch.qos.logback.core.spi.DeferredProcessingAware>

  • All Implemented Interfaces:
    Discoverable, AppenderFactory<E>
    Direct Known Subclasses:
    TlsSocketAppenderFactory

    public class TcpSocketAppenderFactory<E extends ch.qos.logback.core.spi.DeferredProcessingAware>
    extends AbstractOutputStreamAppenderFactory<E>
    An AppenderFactory implementation which provides an appender that writes events to a TCP socket.

    Configuration Parameters:

    Name Default Description
    host localhost The hostname of the TCP server.
    port 4560 The port on which the TCP server is listening.
    connectionTimeout 500 ms The timeout to connect to the TCP server.
    immediateFlush true If set to true, log events will be immediately send to the server. Immediate flushing is safer, but it degrades logging throughput.
    sendBufferSize 8KiB The buffer size of the underlying SocketAppender. Takes into effect if immediateFlush is disabled.
    • Constructor Detail

      • TcpSocketAppenderFactory

        public TcpSocketAppenderFactory()
    • Method Detail

      • getHost

        public String getHost()
      • setHost

        public void setHost​(String host)
      • getPort

        public int getPort()
      • setPort

        public void setPort​(int port)
      • getConnectionTimeout

        public Duration getConnectionTimeout()
      • setConnectionTimeout

        public void setConnectionTimeout​(Duration connectionTimeout)
      • isImmediateFlush

        public boolean isImmediateFlush()
      • setImmediateFlush

        public void setImmediateFlush​(boolean immediateFlush)
      • getSendBufferSize

        public DataSize getSendBufferSize()
      • setSendBufferSize

        public void setSendBufferSize​(DataSize sendBufferSize)
      • appender

        protected ch.qos.logback.core.OutputStreamAppender<E> appender​(ch.qos.logback.classic.LoggerContext context)
        Specified by:
        appender in class AbstractOutputStreamAppenderFactory<E extends ch.qos.logback.core.spi.DeferredProcessingAware>