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

    https://github.com/apache/logging-log4j2/pull/206#discussion_r208735895
  
    --- Diff: 
log4j-redis/src/main/java/org/apache/logging/log4j/redis/appender/RedisAppender.java
 ---
    @@ -0,0 +1,202 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements. See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache license, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License. You may obtain a copy of the License at
    + *
    + *      http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the license for the specific language governing permissions and
    + * limitations under the license.
    + */
    +
    +package org.apache.logging.log4j.redis.appender;
    +
    +import org.apache.logging.log4j.core.Appender;
    +import org.apache.logging.log4j.core.Filter;
    +import org.apache.logging.log4j.core.Layout;
    +import org.apache.logging.log4j.core.LogEvent;
    +import org.apache.logging.log4j.core.appender.AbstractAppender;
    +import org.apache.logging.log4j.core.config.Node;
    +import org.apache.logging.log4j.core.config.plugins.Plugin;
    +import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
    +import org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory;
    +import 
org.apache.logging.log4j.core.config.plugins.validation.constraints.Required;
    +import org.apache.logging.log4j.core.layout.AbstractStringLayout;
    +
    +import java.io.Serializable;
    +import java.nio.charset.Charset;
    +import java.util.Objects;
    +import java.util.concurrent.TimeUnit;
    +
    +/**
    + * Sends log events to a Redis Queue. All logs are appended Redis lists 
via the RPUSH command.
    + */
    +@Plugin(name = "Redis", category = Node.CATEGORY, elementType = 
Appender.ELEMENT_TYPE, printObject = true)
    +public final class RedisAppender extends AbstractAppender {
    +
    +    private RedisAppender(final String name, final Layout<? extends 
Serializable> layout, final Filter filter,
    +                          final boolean ignoreExceptions, final 
RedisManager manager) {
    +        super(name, filter, layout, ignoreExceptions);
    +        this.manager = Objects.requireNonNull(manager, "Redis Manager");
    +    }
    +
    +    /**
    +     * Builds RedisAppender instances.
    +     * @param <B> The type to build
    +     */
    +    public static class Builder<B extends Builder<B>> extends 
AbstractAppender.Builder<B>
    +            implements 
org.apache.logging.log4j.core.util.Builder<RedisAppender> {
    +
    +        @PluginAttribute("keys")
    +        private String[] keys;
    +
    +        @PluginAttribute(value = "host")
    +        @Required(message = "No Redis hostname provided")
    +        private String host;
    +
    +        @PluginAttribute(value = "port")
    +        private int port;
    +
    +        @PluginAttribute(value = "ssl")
    +        private boolean ssl = false;
    --- End diff --
    
    +1


---

Reply via email to