@Plugin(name="JDBC", category="Core", elementType="appender", printObject=true) public final class JdbcAppender extends AbstractDatabaseAppender<JdbcDatabaseManager>
ColumnConfig
s and/or ColumnMapping
s 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.State
DEFAULT_RECONNECT_INTERVAL_MILLIS
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
ELEMENT_TYPE, EMPTY_ARRAY
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, stop
error, error, error, getHandler, getName, ignoreExceptions, parseInt, requiresLocation, setHandler, toSerializable
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, stop
equalsImpl, 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 AbstractAppender
Copyright © 1999-2023 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.