org.apache.logging.log4j.core.appender
Class FailoverAppender
java.lang.Object
org.apache.logging.log4j.core.filter.Filterable
org.apache.logging.log4j.core.appender.AppenderBase
org.apache.logging.log4j.core.appender.FailoverAppender
- All Implemented Interfaces:
- Appender, Filtering, Lifecycle
public final class FailoverAppender
- extends AppenderBase
The FailoverAppender will capture exceptions in an Appender and then route the event
to a different appender. Hopefully it is obvious that the Appenders must be configured
to not suppress exceptions for the FailoverAppender to work.
Methods inherited from class org.apache.logging.log4j.core.appender.AppenderBase |
close, error, error, error, getHandler, getLayout, getName, isExceptionSuppressed, isStarted, setHandler, stop |
start
public void start()
- Description copied from class:
AppenderBase
- Start the Appender.
- Specified by:
start
in interface Lifecycle
- Overrides:
start
in class AppenderBase
append
public void append(LogEvent event)
- Handle the Log event.
- Parameters:
event
- The LogEvent.
toString
public String toString()
- Overrides:
toString
in class AppenderBase
createAppender
public static FailoverAppender createAppender(String name,
String primary,
String[] failovers,
Configuration config,
Filter filter,
String suppress)
- Create a Failover Appender.
- Parameters:
name
- The name of the Appender (required).primary
- The name of the primary Appender (required).failovers
- The name of one or more Appenders to fail over to (at least one is required).config
- The current Configuration (passed by the Configuration when the appender is created).filter
- A Filter (optional).suppress
- "true" if exceptions should be hidden from the application, "false" otherwise.
The default is "true".
- Returns:
- The FailoverAppender that was created.
Copyright © 1999-2012 Apache Software Foundation. All Rights Reserved.