|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.core.filter.AbstractFilterable
org.apache.logging.log4j.core.appender.AbstractAppender<LogEvent>
org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender<T>
T
- Specifies which type of AbstractDatabaseManager
this Appender requires.public abstract class AbstractDatabaseAppender<T extends AbstractDatabaseManager>
An abstract Appender for writing events to a database of some type, be it relational or NoSQL. All database appenders
should inherit from this base appender. Three implementations are currently provided:
JDBC
, JPA
, and NoSQL
.
Field Summary |
---|
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractAppender |
---|
LOGGER |
Constructor Summary | |
---|---|
protected |
AbstractDatabaseAppender(String name,
Filter filter,
boolean handleException,
T manager)
Instantiates the base appender. |
Method Summary | |
---|---|
void |
append(LogEvent event)
Log in Appender specific way. |
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()
Start the Appender. |
void |
stop()
Stop the Appender. |
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender |
---|
error, error, error, getHandler, getName, isExceptionSuppressed, isStarted, parseInt, setHandler, toString |
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable |
---|
addFilter, getFilter, hasFilter, isFiltered, removeFilter, startFilter, stopFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected AbstractDatabaseAppender(String name, Filter filter, boolean handleException, T manager)
name
- The appender name.filter
- The filter, if any, to use.handleException
- Whether logging exceptions should be reported to the application.manager
- The matching AbstractDatabaseManager
implementation.Method Detail |
---|
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<LogEvent>
getLayout
in class AbstractAppender<LogEvent>
null
.public final T getManager()
public final void start()
AbstractAppender
start
in interface LifeCycle
start
in class AbstractAppender<LogEvent>
public final void stop()
AbstractAppender
stop
in interface LifeCycle
stop
in class AbstractAppender<LogEvent>
public final void append(LogEvent event)
Appender
Appender
specific way. When appropriate,
Loggers will call the doAppend
method of appender
implementations in order to log.
event
- The LogEvent.protected final void replaceManager(T manager)
manager
- The new manager to install.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2013 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.