Package org.apache.log4j.db
package org.apache.log4j.db
The org.apache.log4j.db package provides means to append logging events
into various databases. The persisted data can be later read back using
DBReceiver
.
Most popular database systems, such as PostgreSQL, MySQL, Oracle, DB2 and MsSQL are supported.
Just as importantly, the way for obtaining JDBC connections is pluggable. Connections can be obtained through the tradinal way of DriverManager, or alternatively as a DataSource. A DataSource can be instantiated directly or it can obtained through JNDI.
-
ClassDescriptionThe
ConnectionSource
interface provides a pluggable means of transparently obtaining JDBCConnection
s for log4j classes that require the use of aConnection
.Converts log data stored in a database into LoggingEvents.The DataSourceConnectionSource is an implementation ofConnectionSource
that obtains the Connection in the recommended JDBC manner based on aDataSource
.The DBAppender inserts loggin events into three database tables in a format independent of the Java programming language.Actual retrieval of data is made by the instance of DBReceiverJob associated with DBReceiver.The DriverManagerConnectionSource is an implementation ofConnectionSource
that obtains the Connection in the traditional JDBC manner based on the connection URL.TheJNDIConnectionSource
is an implementation ofConnectionSource
that obtains aDataSource
from a JNDI provider and uses it to obtain aConnection
.