org.apache.log.output.db

Class NormalizedJDBCTarget

Implemented Interfaces:
ErrorAware, LogTarget

public class NormalizedJDBCTarget
extends DefaultJDBCTarget

JDBC target that writes to normalized tables. This reduces overhead and cost of querying/storing logs.

Parts based on JDBC logger from prottomatter by Nate Sammons

Author:
Peter Donald

Constructor Summary

NormalizedJDBCTarget(DataSource dataSource, String table, ColumnInfo[] columns)
Creation of a new JDBC logging target.

Method Summary

protected int
getID(String tableName, HashMap idMap, String instance)
protected void
specifyColumn(PreparedStatement statement, int index, LogEvent event)
Adds a single object into statement.

Methods inherited from class org.apache.log.output.db.DefaultJDBCTarget

closeConnection, getColumn, getStatementSQL, getTable, isStale, openConnection, output, specifyColumn

Methods inherited from class org.apache.log.output.db.AbstractJDBCTarget

checkConnection, close, closeConnection, doProcessEvent, getConnection, isStale, open, openConnection, output

Methods inherited from class org.apache.log.output.AbstractTarget

close, doProcessEvent, error, getErrorHandler, isOpen, open, processEvent, setErrorHandler

Constructor Details

NormalizedJDBCTarget

public NormalizedJDBCTarget(DataSource dataSource,
                            String table,
                            ColumnInfo[] columns)
Creation of a new JDBC logging target.
Parameters:
dataSource - the JDBC datasource
table - the table
columns - a ColumnInfo array

Method Details

getID

protected int getID(String tableName,
                    HashMap idMap,
                    String instance)
            throws SQLException

specifyColumn

protected void specifyColumn(PreparedStatement statement,
                             int index,
                             LogEvent event)
            throws SQLException
Adds a single object into statement.
Overrides:
specifyColumn in interface DefaultJDBCTarget