[ 
https://issues.apache.org/jira/browse/LOG4J2-2400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16576129#comment-16576129
 ] 

ASF GitHub Bot commented on LOG4J2-2400:
----------------------------------------

Github user aaabramov commented on a diff in the pull request:

    https://github.com/apache/logging-log4j2/pull/206#discussion_r209227995
  
    --- Diff: 
log4j-redis/src/main/java/org/apache/logging/log4j/redis/appender/RedisManager.java
 ---
    @@ -0,0 +1,104 @@
    +package org.apache.logging.log4j.redis.appender;
    +
    +import org.apache.logging.log4j.core.LoggerContext;
    +import org.apache.logging.log4j.core.appender.AbstractManager;
    +import org.apache.logging.log4j.core.net.ssl.SslConfiguration;
    +import redis.clients.jedis.Jedis;
    +import redis.clients.jedis.JedisPool;
    +import redis.clients.jedis.JedisPoolConfig;
    +import redis.clients.jedis.exceptions.JedisConnectionException;
    +
    +import java.net.URI;
    +import java.util.Queue;
    +import java.util.concurrent.TimeUnit;
    +
    +class RedisManager extends AbstractManager {
    +
    +    private final String[] keys;
    +    private final String host;
    +    private final int port;
    +    private final SslConfiguration sslConfiguration;
    +    private final JedisPoolConfig poolConfiguration;
    +    private JedisPool jedisPool;
    +
    +    RedisManager(LoggerContext loggerContext, String name, String[] keys, 
String host, int port,
    +                 SslConfiguration sslConfiguration, 
LoggingJedisPoolConfiguration poolConfiguration) {
    +        super(loggerContext, name);
    +        this.keys = keys;
    +        this.host = host;
    +        this.port = port;
    +        this.sslConfiguration = sslConfiguration;
    +        if (poolConfiguration == null) {
    +            this.poolConfiguration = 
LoggingJedisPoolConfiguration.defaultConfiguration();
    +        } else {
    +            this.poolConfiguration = poolConfiguration;
    +        }
    +    }
    +
    +    JedisPool createPool(String host, int port, SslConfiguration 
sslConfiguration) {
    +        if (sslConfiguration != null) {
    +            return new JedisPool(
    +                    poolConfiguration,
    +                    URI.create(host + ":" + String.valueOf(port)),
    --- End diff --
    
    What is the purpose of explicitly stringifying `port `?


> Support for log4j2 RedisAppender
> --------------------------------
>
>                 Key: LOG4J2-2400
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2400
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Appenders
>            Reporter: Kevin Andrew Meurer
>            Priority: Major
>
> Redis functions well as a temporary queue for event data en route to another 
> data store. For example, Redis may be used to improve the fault-tolerance of 
> a logging pipeline by serving as an intermediary as log events move to a 
> separate storage layer (i.e. log4j2 - > Redis < - Logstash -> Elasticsearch).
> As a result, event processing applications may wish to use Redis instead of 
> Kafka as a message broker. We should add support for a RedisAppender to 
> support this use case.
> Relevant dev list thread: 
> [https://lists.apache.org/thread.html/4967cf3cd4db367ba563143ccd1438b7c53830671881eb692642b8d9@%3Cdev.logging.apache.org%3E]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to