public class TCPNetSyslogWriter extends AbstractSyslogWriter
When used in "threaded" mode (see TCPNetSyslogConfig for the option), a queuing mechanism is used (via LinkedList).
Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy of the LGPL license is available in the META-INF folder in all distributions of Syslog4j and in the base directory of the "doc" ZIP.
| Modifier and Type | Field and Description |
|---|---|
protected long |
lastSocketCreationTimeMs |
protected Socket |
socket |
protected TCPNetSyslog |
tcpNetSyslog |
protected TCPNetSyslogConfigIF |
tcpNetSyslogConfig |
queuedMessages, shutdown, syslog, syslogConfig, thread| Constructor and Description |
|---|
TCPNetSyslogWriter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeSocket(Socket socketToClose) |
protected Socket |
createSocket(InetAddress hostAddress,
int port,
boolean keepalive) |
void |
flush() |
protected Socket |
getSocket() |
void |
initialize(AbstractSyslog abstractSyslog) |
protected SocketFactory |
obtainSocketFactory() |
protected void |
runCompleted() |
void |
shutdown() |
void |
write(byte[] message) |
hasThread, queue, run, setThreadprotected TCPNetSyslog tcpNetSyslog
protected Socket socket
protected TCPNetSyslogConfigIF tcpNetSyslogConfig
protected long lastSocketCreationTimeMs
public void initialize(AbstractSyslog abstractSyslog)
initialize in class AbstractSyslogWriterprotected SocketFactory obtainSocketFactory()
protected Socket createSocket(InetAddress hostAddress, int port, boolean keepalive) throws IOException
IOExceptionprotected Socket getSocket() throws SyslogRuntimeException
SyslogRuntimeExceptionprotected void closeSocket(Socket socketToClose)
public void write(byte[] message)
throws SyslogRuntimeException
write in class AbstractSyslogWriterSyslogRuntimeExceptionpublic void flush()
throws SyslogRuntimeException
flush in class AbstractSyslogWriterSyslogRuntimeExceptionpublic void shutdown()
throws SyslogRuntimeException
shutdown in class AbstractSyslogWriterSyslogRuntimeExceptionprotected void runCompleted()
runCompleted in class AbstractSyslogWriterCopyright © 2017. All rights reserved.