Class JdbcAppender.Builder<B extends JdbcAppender.Builder<B>>
- java.lang.Object
-
- org.apache.logging.log4j.core.filter.AbstractFilterable.Builder<B>
-
- org.apache.logging.log4j.core.appender.AbstractAppender.Builder<B>
-
- org.apache.logging.log4j.core.appender.db.jdbc.JdbcAppender.Builder<B>
-
- All Implemented Interfaces:
Builder<JdbcAppender>
- Enclosing class:
- JdbcAppender
public static class JdbcAppender.Builder<B extends JdbcAppender.Builder<B>> extends AbstractAppender.Builder<B> implements Builder<JdbcAppender>
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JdbcAppender
build()
Builds the object after all configuration has been set.B
setBufferSize(int bufferSize)
If an integer greater than 0, this causes the appender to buffer log events and flush whenever the buffer reaches this size.B
setColumnConfigs(ColumnConfig... columnConfigs)
Information about the columns that log event data should be inserted into and how to insert that data.B
setColumnMappings(ColumnMapping... columnMappings)
B
setConnectionSource(ConnectionSource connectionSource)
The connections source from which database connections should be retrieved.B
setTableName(java.lang.String tableName)
The name of the database table to insert log events into.-
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender.Builder
getConfiguration, getLayout, getName, getOrCreateLayout, getOrCreateLayout, isIgnoreExceptions, setConfiguration, withConfiguration, withIgnoreExceptions, withLayout, withName
-
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable.Builder
asBuilder, getFilter, withFilter
-
-
-
-
Method Detail
-
setConnectionSource
public B setConnectionSource(ConnectionSource connectionSource)
The connections source from which database connections should be retrieved.- Returns:
- this
-
setBufferSize
public B setBufferSize(int bufferSize)
If an integer greater than 0, this causes the appender to buffer log events and flush whenever the buffer reaches this size.- Returns:
- this
-
setTableName
public B setTableName(java.lang.String tableName)
The name of the database table to insert log events into.- Returns:
- this
-
setColumnConfigs
public B setColumnConfigs(ColumnConfig... columnConfigs)
Information about the columns that log event data should be inserted into and how to insert that data.- Returns:
- this
-
setColumnMappings
public B setColumnMappings(ColumnMapping... columnMappings)
-
build
public JdbcAppender build()
Description copied from interface:Builder
Builds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.- Specified by:
build
in interfaceBuilder<B extends JdbcAppender.Builder<B>>
- Returns:
- the configured instance.
-
-