Class SocketAppender

    • Field Detail

      • advertisement

        private final java.lang.Object advertisement
    • Method Detail

      • stop

        public boolean stop​(long timeout,
                            java.util.concurrent.TimeUnit timeUnit)
        Description copied from class: AbstractFilterable
        Cleanup the Filter.
        Specified by:
        stop in interface LifeCycle2
        Overrides:
        stop in class AbstractOutputStreamAppender<AbstractSocketManager>
        Parameters:
        timeout - the maximum time to wait
        timeUnit - the time unit of the timeout argument
        Returns:
        true if the receiver was stopped cleanly and normally, false otherwise.
      • createAppender

        @Deprecated
        @PluginFactory
        public static SocketAppender createAppender​(java.lang.String host,
                                                    int port,
                                                    Protocol protocol,
                                                    SslConfiguration sslConfig,
                                                    int connectTimeoutMillis,
                                                    int reconnectDelayMillis,
                                                    boolean immediateFail,
                                                    java.lang.String name,
                                                    boolean immediateFlush,
                                                    boolean ignoreExceptions,
                                                    Layout<? extends java.io.Serializable> layout,
                                                    Filter filter,
                                                    boolean advertise,
                                                    Configuration configuration)
        Deprecated.
        Deprecated in 2.7; use newBuilder()
        Creates a socket appender.
        Parameters:
        host - The name of the host to connect to.
        port - The port to connect to on the target host.
        protocol - The Protocol to use.
        sslConfig - The SSL configuration file for TCP/SSL, ignored for UPD.
        connectTimeoutMillis - the connect timeout in milliseconds.
        reconnectDelayMillis - The interval in which failed writes should be retried.
        immediateFail - True if the write should fail if no socket is immediately available.
        name - The name of the Appender.
        immediateFlush - "true" if data should be flushed on each write.
        ignoreExceptions - If "true" (default) exceptions encountered when appending events are logged; otherwise they are propagated to the caller.
        layout - The layout to use. Required, there is no default.
        filter - The Filter or null.
        advertise - "true" if the appender configuration should be advertised, "false" otherwise.
        configuration - The Configuration
        Returns:
        A SocketAppender.
      • createAppender

        @Deprecated
        public static SocketAppender createAppender​(java.lang.String host,
                                                    java.lang.String portNum,
                                                    java.lang.String protocolIn,
                                                    SslConfiguration sslConfig,
                                                    int connectTimeoutMillis,
                                                    java.lang.String delayMillis,
                                                    java.lang.String immediateFail,
                                                    java.lang.String name,
                                                    java.lang.String immediateFlush,
                                                    java.lang.String ignore,
                                                    Layout<? extends java.io.Serializable> layout,
                                                    Filter filter,
                                                    java.lang.String advertise,
                                                    Configuration config)
        Deprecated.
        Deprecated in 2.5; use newBuilder()
        Creates a socket appender.
        Parameters:
        host - The name of the host to connect to.
        portNum - The port to connect to on the target host.
        protocolIn - The Protocol to use.
        sslConfig - The SSL configuration file for TCP/SSL, ignored for UPD.
        connectTimeoutMillis - the connect timeout in milliseconds.
        delayMillis - The interval in which failed writes should be retried.
        immediateFail - True if the write should fail if no socket is immediately available.
        name - The name of the Appender.
        immediateFlush - "true" if data should be flushed on each write.
        ignore - If "true" (default) exceptions encountered when appending events are logged; otherwise they are propagated to the caller.
        layout - The layout to use. Required, there is no default.
        filter - The Filter or null.
        advertise - "true" if the appender configuration should be advertised, "false" otherwise.
        config - The Configuration
        Returns:
        A SocketAppender.
      • createSocketManager

        protected static AbstractSocketManager createSocketManager​(java.lang.String name,
                                                                   Protocol protocol,
                                                                   java.lang.String host,
                                                                   int port,
                                                                   int connectTimeoutMillis,
                                                                   SslConfiguration sslConfig,
                                                                   int reconnectDelayMillis,
                                                                   boolean immediateFail,
                                                                   Layout<? extends java.io.Serializable> layout,
                                                                   int bufferSize,
                                                                   SocketOptions socketOptions)
        Creates an AbstractSocketManager for TCP, UDP, and SSL.
        Throws:
        java.lang.IllegalArgumentException - if the protocol cannot be handled.