public class TcpSocketAppenderFactory<E extends ch.qos.logback.core.spi.DeferredProcessingAware> extends AbstractOutputStreamAppenderFactory<E>
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. |
layout, logFormat, threshold, timeZone
Constructor and Description |
---|
TcpSocketAppenderFactory() |
Modifier and Type | Method and Description |
---|---|
protected ch.qos.logback.core.OutputStreamAppender<E> |
appender(ch.qos.logback.classic.LoggerContext context) |
Duration |
getConnectionTimeout() |
String |
getHost() |
int |
getPort() |
DataSize |
getSendBufferSize() |
boolean |
isImmediateFlush() |
void |
setConnectionTimeout(Duration connectionTimeout) |
void |
setHost(String host) |
void |
setImmediateFlush(boolean immediateFlush) |
void |
setPort(int port) |
void |
setSendBufferSize(DataSize sendBufferSize) |
protected SocketFactory |
socketFactory() |
build
buildLayout, getDiscardingThreshold, getFilterFactories, getLayout, getLogFormat, getMessageRate, getQueueSize, getThreshold, getTimeZone, isIncludeCallerData, setDiscardingThreshold, setFilterFactories, setIncludeCallerData, setLayout, setLogFormat, setMessageRate, setNeverBlock, setQueueSize, setThreshold, setTimeZone, setTimeZone, wrapAsync, wrapAsync
public String getHost()
public void setHost(String host)
public int getPort()
public void setPort(int port)
public Duration getConnectionTimeout()
public void setConnectionTimeout(Duration connectionTimeout)
public boolean isImmediateFlush()
public void setImmediateFlush(boolean immediateFlush)
public DataSize getSendBufferSize()
public void setSendBufferSize(DataSize sendBufferSize)
protected ch.qos.logback.core.OutputStreamAppender<E> appender(ch.qos.logback.classic.LoggerContext context)
appender
in class AbstractOutputStreamAppenderFactory<E extends ch.qos.logback.core.spi.DeferredProcessingAware>
protected SocketFactory socketFactory()
Copyright © 2011. All rights reserved.