Class NormalizedJDBCTarget

  • All Implemented Interfaces:
    ErrorAware, LogTarget, Closeable

    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
    • Field Detail

      • m_categoryIDs

        private java.util.HashMap m_categoryIDs
      • m_priorityIDs

        private java.util.HashMap m_priorityIDs
    • Constructor Detail

      • NormalizedJDBCTarget

        public NormalizedJDBCTarget​(javax.sql.DataSource dataSource,
                                    java.lang.String table,
                                    ColumnInfo[] columns)
    • Method Detail

      • specifyColumn

        protected void specifyColumn​(java.sql.PreparedStatement statement,
                                     int index,
                                     LogEvent event)
                              throws java.sql.SQLException
        Adds a single object into statement.
        Overrides:
        specifyColumn in class DefaultJDBCTarget
        Parameters:
        statement - the prepard statement
        index - the index
        event - the log event
        Throws:
        java.sql.SQLException - if an SQL related error occurs
      • getID

        protected int getID​(java.lang.String tableName,
                            java.util.HashMap idMap,
                            java.lang.String instance)
                     throws java.sql.SQLException
        Throws:
        java.sql.SQLException