The gist of what you're probably looking for is a failover appender configuration: < https://logging.apache.org/log4j/2.x/manual/appenders.html#FailoverAppender>. This can be used to switch to another appender when one fails which is perfect for networked appenders.
On 14 March 2017 at 07:00, Yang Rui <yang_ru...@outlook.com> wrote: > Hi, > > I am Rui from China. > > We use both of KafkaAppender (with a AsyncAppender wrapper) > and FileAppender of log4j2 with version 2.6.2 in the application. > > Here is the scenaria, when kafka cluster down and stop > service, the application will slow down and wait for given timeout ( > request.timeout.ms) > > to response finally (The bufferSize of AsyncKafka is reached). > > I am wondering if there is any solution that the > fileAppender can always work normally without any performance issue which > affected > > by KafkaAppender. In other words, the KafkaAppender can " > DISCARD" the logs when kafka cluster down while the application > > can output the logs by FileAppender. > > > Thanks, > Rui > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org > For additional commands, e-mail: log4j-user-h...@logging.apache.org > -- Matt Sicker <boa...@gmail.com>