T
- Specifies which type of AbstractDatabaseManager
this Appender requires.public abstract class AbstractDatabaseAppender<T extends AbstractDatabaseManager> extends AbstractAppender
Modifier and Type | Class and Description |
---|---|
static class |
AbstractDatabaseAppender.Builder<B extends AbstractDatabaseAppender.Builder<B>> |
LifeCycle.State
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_RECONNECT_INTERVAL_MILLIS |
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
ELEMENT_TYPE
Modifier | Constructor and Description |
---|---|
protected |
AbstractDatabaseAppender(String name,
Filter filter,
boolean ignoreExceptions,
T manager)
|
protected |
AbstractDatabaseAppender(String name,
Filter filter,
Layout<? extends Serializable> layout,
boolean ignoreExceptions,
Property[] properties,
T manager)
Instantiates the base appender.
|
protected |
AbstractDatabaseAppender(String name,
Filter filter,
Layout<? extends Serializable> layout,
boolean ignoreExceptions,
T manager)
|
Modifier and Type | Method and Description |
---|---|
void |
append(LogEvent event)
Logs a LogEvent using whatever logic this Appender wishes to use.
|
Layout<LogEvent> |
getLayout()
This always returns
null , as database appenders do not use a single layout. |
T |
getManager()
Returns the underlying manager in use within this appender.
|
protected void |
replaceManager(T manager)
Replaces the underlying manager in use within this appender.
|
void |
start()
Make the Filter available for use.
|
boolean |
stop(long timeout,
TimeUnit timeUnit)
Cleanup the Filter.
|
error, error, error, getHandler, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializable, toString
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, stop
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
public static final int DEFAULT_RECONNECT_INTERVAL_MILLIS
@Deprecated protected AbstractDatabaseAppender(String name, Filter filter, boolean ignoreExceptions, T manager)
AbstractDatabaseAppender(String, Filter, Layout, boolean, Property[], AbstractDatabaseManager)
.name
- The appender name.filter
- The filter, if any, to use.ignoreExceptions
- If true
exceptions encountered when appending events are logged; otherwise
they are propagated to the caller.manager
- The matching AbstractDatabaseManager
implementation.protected AbstractDatabaseAppender(String name, Filter filter, Layout<? extends Serializable> layout, boolean ignoreExceptions, Property[] properties, T manager)
name
- The appender name.filter
- The filter, if any, to use.layout
- The layout to use to format the event.ignoreExceptions
- If true
exceptions encountered when appending events are logged; otherwise
they are propagated to the caller.manager
- The matching AbstractDatabaseManager
implementation.@Deprecated protected AbstractDatabaseAppender(String name, Filter filter, Layout<? extends Serializable> layout, boolean ignoreExceptions, T manager)
AbstractDatabaseAppender(String, Filter, Layout, boolean, Property[], AbstractDatabaseManager)
name
- The appender name.filter
- The filter, if any, to use.layout
- The layout to use to format the event.ignoreExceptions
- If true
exceptions encountered when appending events are logged; otherwise
they are propagated to the caller.manager
- The matching AbstractDatabaseManager
implementation.public final void append(LogEvent event)
Appender
event
- The LogEvent.public final Layout<LogEvent> getLayout()
null
, as database appenders do not use a single layout. The JPA and NoSQL appenders
do not use a layout at all. The JDBC appender has a layout-per-column pattern.getLayout
in interface Appender
getLayout
in class AbstractAppender
null
.public final T getManager()
protected final void replaceManager(T manager)
manager
- The new manager to install.public final void start()
AbstractFilterable
start
in interface LifeCycle
start
in class AbstractFilterable
public boolean stop(long timeout, TimeUnit timeUnit)
AbstractFilterable
stop
in interface LifeCycle2
stop
in class AbstractFilterable
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argumentCopyright © 1999-2021 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.