org.apache.logging.log4j.core.appender.db.jdbc
Class JDBCDatabaseManager
java.lang.Object
org.apache.logging.log4j.core.appender.AbstractManager
org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager
org.apache.logging.log4j.core.appender.db.jdbc.JDBCDatabaseManager
public final class JDBCDatabaseManager
- extends AbstractDatabaseManager
An AbstractDatabaseManager
implementation for relational databases accessed via JDBC.
connectInternal
protected void connectInternal()
throws SQLException
- Description copied from class:
AbstractDatabaseManager
- Implementations should implement this method to perform any proprietary connection operations. This method will
never be called twice on the same instance. It is safe to throw any exceptions from this method.
- Specified by:
connectInternal
in class AbstractDatabaseManager
- Throws:
SQLException
disconnectInternal
protected void disconnectInternal()
throws SQLException
- Description copied from class:
AbstractDatabaseManager
- Implementations should implement this method to perform any proprietary disconnection / shutdown operations. This
method will never be called twice on the same instance, and it will only be called after
AbstractDatabaseManager.connectInternal()
. It is safe to throw any exceptions from this method.
- Specified by:
disconnectInternal
in class AbstractDatabaseManager
- Throws:
SQLException
writeInternal
protected void writeInternal(LogEvent event)
- Description copied from class:
AbstractDatabaseManager
- Performs the actual writing of the event in an implementation-specific way. This method is called immediately
from
AbstractDatabaseManager.write(LogEvent)
if buffering is off, or from AbstractDatabaseManager.flush()
if the buffer has reached its limit.
- Specified by:
writeInternal
in class AbstractDatabaseManager
- Parameters:
event
- The event to write to the database.
getJDBCDatabaseManager
public static JDBCDatabaseManager getJDBCDatabaseManager(String name,
int bufferSize,
ConnectionSource connectionSource,
String tableName,
ColumnConfig[] columnConfigs)
- Creates a JDBC manager for use within the
JDBCAppender
, or returns a suitable one if it already exists.
- Parameters:
name
- The name of the manager, which should include connection details and hashed passwords where possible.bufferSize
- The size of the log event buffer.connectionSource
- The source for connections to the database.tableName
- The name of the database table to insert log events into.columnConfigs
- Configuration information about the log table columns.
- Returns:
- a new or existing JDBC manager as applicable.
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.