Search in sources :

Example 1 with Protocol

use of org.apache.logging.log4j.core.net.Protocol in project logging-log4j2 by apache.

the class SocketAppender method createAppender.

/**
     * Creates a socket appender.
     *
     * @param host
     *            The name of the host to connect to.
     * @param portNum
     *            The port to connect to on the target host.
     * @param protocolIn
     *            The Protocol to use.
     * @param sslConfig
     *            The SSL configuration file for TCP/SSL, ignored for UPD.
     * @param connectTimeoutMillis
     *            the connect timeout in milliseconds.
     * @param delayMillis
     *            The interval in which failed writes should be retried.
     * @param immediateFail
     *            True if the write should fail if no socket is immediately available.
     * @param name
     *            The name of the Appender.
     * @param immediateFlush
     *            "true" if data should be flushed on each write.
     * @param ignore
     *            If {@code "true"} (default) exceptions encountered when appending events are logged; otherwise they
     *            are propagated to the caller.
     * @param layout
     *            The layout to use (defaults to {@link SerializedLayout}).
     * @param filter
     *            The Filter or null.
     * @param advertise
     *            "true" if the appender configuration should be advertised, "false" otherwise.
     * @param config
     *            The Configuration
     * @return A SocketAppender.
     * @deprecated Deprecated in 2.5; use {@link #newBuilder()}
     */
@Deprecated
public static SocketAppender createAppender(// @formatter:off
final String host, final String portNum, final String protocolIn, final SslConfiguration sslConfig, final int connectTimeoutMillis, // deprecated
final String delayMillis, final String immediateFail, final String name, final String immediateFlush, final String ignore, final Layout<? extends Serializable> layout, final Filter filter, final String advertise, final Configuration config) {
    // @formatter:on
    final boolean isFlush = Booleans.parseBoolean(immediateFlush, true);
    final boolean isAdvertise = Boolean.parseBoolean(advertise);
    final boolean ignoreExceptions = Booleans.parseBoolean(ignore, true);
    final boolean fail = Booleans.parseBoolean(immediateFail, true);
    final int reconnectDelayMillis = AbstractAppender.parseInt(delayMillis, 0);
    final int port = AbstractAppender.parseInt(portNum, 0);
    final Protocol p = protocolIn == null ? Protocol.UDP : Protocol.valueOf(protocolIn);
    return createAppender(host, port, p, sslConfig, connectTimeoutMillis, reconnectDelayMillis, fail, name, isFlush, ignoreExceptions, layout, filter, isAdvertise, config);
}
Also used : Protocol(org.apache.logging.log4j.core.net.Protocol)

Aggregations

Protocol (org.apache.logging.log4j.core.net.Protocol)1