@Plugin(name="JDBC", category="Core", elementType="appender", printObject=true) public final class JdbcAppender extends AbstractDatabaseAppender<JdbcDatabaseManager>
ColumnConfig
s with which it determines how to save the event data into the appropriate columns in the table.
A ConnectionSource
plugin instance instructs the appender (and JdbcDatabaseManager
) how to connect to
the database. This appender can be reconfigured at run time.ColumnConfig
,
ConnectionSource
,
Serialized FormLifeCycle.State
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
Modifier and Type | Method and Description |
---|---|
static JdbcAppender |
createAppender(String name,
String ignore,
Filter filter,
ConnectionSource connectionSource,
String bufferSize,
String tableName,
ColumnConfig[] columnConfigs)
Factory method for creating a JDBC appender within the plugin manager.
|
String |
toString() |
append, getLayout, getManager, replaceManager, start, stop
error, error, error, getHandler, getName, ignoreExceptions, parseInt, setHandler
addFilter, getFilter, hasFilter, isFiltered, removeFilter
equalsImpl, getState, hashCodeImpl, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping
public String toString()
toString
in class AbstractAppender
@PluginFactory public static JdbcAppender createAppender(@PluginAttribute(value="name") String name, @PluginAttribute(value="ignoreExceptions") String ignore, @PluginElement(value="Filter") Filter filter, @PluginElement(value="ConnectionSource") ConnectionSource connectionSource, @PluginAttribute(value="bufferSize") String bufferSize, @PluginAttribute(value="tableName") String tableName, @PluginElement(value="ColumnConfigs") ColumnConfig[] columnConfigs)
name
- The name of the appender.ignore
- If "true"
(default) exceptions encountered when appending events are logged; otherwise
they are propagated to the caller.filter
- The filter, if any, to use.connectionSource
- The connections source from which database connections should be retrieved.bufferSize
- If an integer greater than 0, this causes the appender to buffer log events and flush whenever
the buffer reaches this size.tableName
- The name of the database table to insert log events into.columnConfigs
- Information about the columns that log event data should be inserted into and how to insert
that data.Copyright © 1999-2021 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.