Package io.dropwizard.logging.common
Class TcpSocketAppenderFactory<E extends ch.qos.logback.core.spi.DeferredProcessingAware>
- java.lang.Object
-
- io.dropwizard.logging.common.AbstractAppenderFactory<E>
-
- io.dropwizard.logging.common.AbstractOutputStreamAppenderFactory<E>
-
- io.dropwizard.logging.common.TcpSocketAppenderFactory<E>
-
- All Implemented Interfaces:
Discoverable,AppenderFactory<E>
- Direct Known Subclasses:
TlsSocketAppenderFactory
public class TcpSocketAppenderFactory<E extends ch.qos.logback.core.spi.DeferredProcessingAware> extends AbstractOutputStreamAppenderFactory<E>
AnAppenderFactoryimplementation which provides an appender that writes events to a TCP socket. Configuration Parameters:Name Default Description hostlocalhostThe hostname of the TCP server. port4560The port on which the TCP server is listening. connectionTimeout500 msThe timeout to connect to the TCP server. immediateFlushtrueIf set to true, log events will be immediately send to the server. Immediate flushing is safer, but it degrades logging throughput. sendBufferSize8KiB The buffer size of the underlying SocketAppender. Takes into effect if immediateFlush is disabled.
-
-
Field Summary
-
Fields inherited from class io.dropwizard.logging.common.AbstractAppenderFactory
layout, logFormat, threshold, timeZone
-
-
Constructor Summary
Constructors Constructor Description TcpSocketAppenderFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ch.qos.logback.core.OutputStreamAppender<E>appender(ch.qos.logback.classic.LoggerContext context)DurationgetConnectionTimeout()StringgetHost()intgetPort()DataSizegetSendBufferSize()booleanisImmediateFlush()voidsetConnectionTimeout(Duration connectionTimeout)voidsetHost(String host)voidsetImmediateFlush(boolean immediateFlush)voidsetPort(int port)voidsetSendBufferSize(DataSize sendBufferSize)protected SocketFactorysocketFactory()-
Methods inherited from class io.dropwizard.logging.common.AbstractOutputStreamAppenderFactory
build
-
Methods inherited from class io.dropwizard.logging.common.AbstractAppenderFactory
buildLayout, getDiscardingThreshold, getFilterFactories, getLayout, getLogFormat, getMessageRate, getQueueSize, getThreshold, getTimeZone, isIncludeCallerData, setDiscardingThreshold, setFilterFactories, setIncludeCallerData, setLayout, setLogFormat, setMessageRate, setNeverBlock, setQueueSize, setThreshold, setTimeZone, setTimeZone, wrapAsync, wrapAsync
-
-
-
-
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:
appenderin classAbstractOutputStreamAppenderFactory<E extends ch.qos.logback.core.spi.DeferredProcessingAware>
-
socketFactory
protected SocketFactory socketFactory()
-
-