Logback API
Version 0.9.8

ch.qos.logback.classic.db
Class DBAppender

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.AppenderBase<E>
          extended by ch.qos.logback.core.db.DBAppenderBase<LoggingEvent>
              extended by ch.qos.logback.classic.db.DBAppender
All Implemented Interfaces:
Appender<LoggingEvent>, ContextAware, FilterAttachable, LifeCycle

public class DBAppender
extends DBAppenderBase<LoggingEvent>

The DBAppender inserts logging events into three database tables in a format independent of the Java programming language. For more information about this appender, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#DBAppender

Author:
Ceki Gülcü, Ray DeCampo, Sébastien Pennec

Field Summary
protected static Method GET_GENERATED_KEYS_METHOD
           
protected  String insertExceptionSQL
           
protected  String insertPropertiesSQL
           
protected static String insertSQL
           
 
Fields inherited from class ch.qos.logback.core.db.DBAppenderBase
cnxSupportsBatchUpdates, cnxSupportsGetGeneratedKeys, connectionSource, sqlDialect
 
Fields inherited from class ch.qos.logback.core.AppenderBase
name, started
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
DBAppender()
           
 
Method Summary
protected  Method getGeneratedKeysMethod()
           
protected  String getInsertSQL()
           
protected  void insertProperties(Map<String,String> mergedMap, Connection connection, int eventId)
           
protected  void insertThrowable(String[] strRep, Connection connection, int eventId)
           
protected  void subAppend(Object eventObject, Connection connection, PreparedStatement insertStatement)
           
 
Methods inherited from class ch.qos.logback.core.db.DBAppenderBase
append, getConnectionSource, getEventId, setConnectionSource, start, stop
 
Methods inherited from class ch.qos.logback.core.AppenderBase
addFilter, clearAllFilters, doAppend, getFilterChainDecision, getFirstFilter, getLayout, getName, isStarted, setLayout, setName, toString
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
 

Field Detail

insertPropertiesSQL

protected final String insertPropertiesSQL
See Also:
Constant Field Values

insertExceptionSQL

protected final String insertExceptionSQL
See Also:
Constant Field Values

insertSQL

protected static final String insertSQL

GET_GENERATED_KEYS_METHOD

protected static final Method GET_GENERATED_KEYS_METHOD
Constructor Detail

DBAppender

public DBAppender()
Method Detail

subAppend

protected void subAppend(Object eventObject,
                         Connection connection,
                         PreparedStatement insertStatement)
                  throws Throwable
Specified by:
subAppend in class DBAppenderBase<LoggingEvent>
Throws:
Throwable

getGeneratedKeysMethod

protected Method getGeneratedKeysMethod()
Specified by:
getGeneratedKeysMethod in class DBAppenderBase<LoggingEvent>

getInsertSQL

protected String getInsertSQL()
Specified by:
getInsertSQL in class DBAppenderBase<LoggingEvent>

insertProperties

protected void insertProperties(Map<String,String> mergedMap,
                                Connection connection,
                                int eventId)
                         throws SQLException
Throws:
SQLException

insertThrowable

protected void insertThrowable(String[] strRep,
                               Connection connection,
                               int eventId)
                        throws SQLException
Throws:
SQLException

Logback API
Version 0.9.8

Copyright © 2005-2008 QOS.ch. All Rights Reserved.