@Plugin(name="JDBC", category="Core", elementType="appender", printObject=true) public final class JdbcAppender extends AbstractDatabaseAppender<JdbcDatabaseManager>
ColumnConfigs and/or ColumnMappings with which it determines how to save the event data into the
appropriate columns in the table. ColumnMapping is new as of Log4j 2.8 and supports
type conversion and persistence using PreparedStatement.setObject(int, Object).
A ConnectionSource plugin instance instructs the appender (and JdbcDatabaseManager) how to connect to
the database. This appender can be reconfigured at run time.ColumnConfig,
ColumnMapping,
ConnectionSource| Modifier and Type | Class and Description |
|---|---|
static class |
JdbcAppender.Builder<B extends JdbcAppender.Builder<B>> |
LifeCycle.StateDEFAULT_RECONNECT_INTERVAL_MILLISDEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGERELEMENT_TYPE| Modifier and Type | Method and Description |
|---|---|
static <B extends JdbcAppender.Builder<B>> |
createAppender(String name,
String ignore,
Filter filter,
ConnectionSource connectionSource,
String bufferSize,
String tableName,
ColumnConfig[] columnConfigs)
Deprecated.
use
newBuilder() |
static <B extends JdbcAppender.Builder<B>> |
newBuilder() |
String |
toString() |
append, getLayout, getManager, replaceManager, start, stoperror, error, error, getHandler, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializableaddFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, stopequalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop@Deprecated public static <B extends JdbcAppender.Builder<B>> JdbcAppender createAppender(String name, String ignore, Filter filter, ConnectionSource connectionSource, String bufferSize, String tableName, ColumnConfig[] columnConfigs)
newBuilder()JdbcAppender.Builder@PluginBuilderFactory public static <B extends JdbcAppender.Builder<B>> B newBuilder()
public String toString()
toString in class AbstractAppenderCopyright © 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.