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

    https://github.com/apache/logging-log4j2/pull/206#discussion_r208730159
  
    --- Diff: 
log4j-redis/src/main/java/org/apache/logging/log4j/redis/appender/RedisManager.java
 ---
    @@ -0,0 +1,86 @@
    +package org.apache.logging.log4j.redis.appender;
    +
    +import org.apache.logging.log4j.core.LoggerContext;
    +import org.apache.logging.log4j.core.appender.AbstractManager;
    +import redis.clients.jedis.Jedis;
    +import redis.clients.jedis.JedisPool;
    +import redis.clients.jedis.JedisPoolConfig;
    +import redis.clients.jedis.exceptions.JedisConnectionException;
    +
    +import java.nio.charset.Charset;
    +import java.util.concurrent.TimeUnit;
    +
    +class RedisManager extends AbstractManager {
    +
    +    private final byte[][] byteKeys;
    +    private final String host;
    +    private final int port;
    +    private final Charset charset;
    +    private final boolean ssl;
    +    private JedisPool jedisPool;
    +
    +    RedisManager(LoggerContext loggerContext, String name, String[] keys, 
String host, int port, boolean ssl, Charset charset) {
    +        super(loggerContext, name);
    +        this.byteKeys = new byte[keys.length][];
    +        for (int i = 0; i < keys.length; i++) {
    +            this.byteKeys[i] = keys[i].getBytes(charset);
    +        }
    +        this.charset = charset;
    +        this.host = host;
    +        this.port = port;
    +        this.ssl = ssl;
    +    }
    +
    +    JedisPool createPool(String host, int port, boolean ssl) {
    +        JedisPoolConfig poolConfig = new JedisPoolConfig();
    +        poolConfig.setMaxIdle(5);
    +        poolConfig.setMinIdle(1);
    +        poolConfig.setTestOnBorrow(true);
    +        poolConfig.setTestOnReturn(true);
    +        poolConfig.setTestWhileIdle(true);
    +        poolConfig.setNumTestsPerEvictionRun(10);
    +        poolConfig.setTimeBetweenEvictionRunsMillis(60000);
    +        return new JedisPool(poolConfig, host, port, ssl);
    --- End diff --
    
    Can we make all the jedis pool config parameters configurable?


---

Reply via email to