Class TLSSyslogConnection


  • public class TLSSyslogConnection
    extends Object
    • Constructor Detail

      • TLSSyslogConnection

        public TLSSyslogConnection​(String syslogHost,
                                   int port,
                                   SSLContext sslContext,
                                   ch.qos.logback.core.net.ssl.SSLParametersConfiguration sslParameters,
                                   int timeoutMillis)
    • Method Detail

      • transmit

        public boolean transmit​(byte[] syslogMessage)
        Writes the messge to the TCP socket's write buffer, attempting to reconnect if necessary
        Returns:
        true if the message has been successfully written to the TCP socket's write buffer, false if any error occurred
      • attemptConnection

        public void attemptConnection()
        Attempts to connect, initializes the clientSocket connected to the syslog server and sets the connection state to connected.

        If the connection attempt is unsuccessful, the error is logged once per application run to stderr, and the connection is left in disconnected state. No exception is thrown in this case to allow logging to the fallback appender or a reconnection attempt in this case.

      • disconnect

        public void disconnect()
      • getLastTransmitError

        public String getLastTransmitError()