|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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
An AbstractDatabaseManager
implementation for relational databases accessed via JDBC.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager |
---|
AbstractDatabaseManager.AbstractFactoryData |
Field Summary |
---|
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractManager |
---|
count, LOGGER |
Method Summary | |
---|---|
protected void |
commitAndClose()
Commits any active transaction (if applicable) and disconnects from the database (returns the connection to the connection pool). |
protected void |
connectAndStart()
Connects to the database and starts a transaction (if applicable). |
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. |
protected void |
shutdownInternal()
Implementations should implement this method to perform any proprietary disconnection / shutdown operations. |
protected void |
startupInternal()
Implementations should implement this method to perform any proprietary startup operations. |
protected void |
writeInternal(LogEvent event)
Performs the actual writing of the event in an implementation-specific way. |
Methods inherited from class org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager |
---|
flush, getManager, isRunning, releaseSub, shutdown, startup, toString, write |
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractManager |
---|
getContentFormat, getCount, getName, hasManager, release |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
protected void startupInternal() throws Exception
AbstractDatabaseManager
startupInternal
in class AbstractDatabaseManager
Exception
protected void shutdownInternal()
AbstractDatabaseManager
AbstractDatabaseManager.startupInternal()
. It is safe to throw any exceptions from this method. This method does not
necessarily disconnect from the database for the same reasons outlined in AbstractDatabaseManager.startupInternal()
.
shutdownInternal
in class AbstractDatabaseManager
protected void connectAndStart()
AbstractDatabaseManager
AbstractDatabaseManager.writeInternal(org.apache.logging.log4j.core.LogEvent)
. With buffering disabled, this is
called immediately before every invocation of AbstractDatabaseManager.writeInternal(org.apache.logging.log4j.core.LogEvent)
.
connectAndStart
in class AbstractDatabaseManager
protected void writeInternal(LogEvent event)
AbstractDatabaseManager
AbstractDatabaseManager.write(LogEvent)
if buffering is off, or from AbstractDatabaseManager.flush()
if the buffer has reached its limit.
writeInternal
in class AbstractDatabaseManager
event
- The event to write to the database.protected void commitAndClose()
AbstractDatabaseManager
AbstractDatabaseManager.writeInternal(org.apache.logging.log4j.core.LogEvent)
. With buffering disabled, this is called immediately after every invocation of
AbstractDatabaseManager.writeInternal(org.apache.logging.log4j.core.LogEvent)
.
commitAndClose
in class AbstractDatabaseManager
public static JdbcDatabaseManager getJDBCDatabaseManager(String name, int bufferSize, ConnectionSource connectionSource, String tableName, ColumnConfig[] columnConfigs)
JdbcAppender
, or returns a suitable one if it already exists.
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2015 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.