Package ch.qos.logback.core.db
Class DBAppenderBase<E>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.UnsynchronizedAppenderBase<E>
ch.qos.logback.core.db.DBAppenderBase<E>
- All Implemented Interfaces:
Appender<E>,ContextAware,FilterAttachable<E>,LifeCycle
- Author:
- Ceki Gülcü, Ray DeCampo, Sébastien Pennec
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected ConnectionSourceprotected SQLDialectFields inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase
name, startedFields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected abstract Methodprotected abstract Stringprotected abstract voidsecondarySubAppend(E eventObject, Connection connection, long eventId)protected longselectEventId(PreparedStatement insertStatement, Connection connection)voidsetConnectionSource(ConnectionSource connectionSource)voidstart()voidstop()protected abstract voidsubAppend(E eventObject, Connection connection, PreparedStatement statement)Methods inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toStringMethods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Field Details
-
connectionSource
-
cnxSupportsGetGeneratedKeys
protected boolean cnxSupportsGetGeneratedKeys -
cnxSupportsBatchUpdates
protected boolean cnxSupportsBatchUpdates -
sqlDialect
-
-
Constructor Details
-
DBAppenderBase
public DBAppenderBase()
-
-
Method Details
-
getGeneratedKeysMethod
-
getInsertSQL
-
start
public void start()- Specified by:
startin interfaceLifeCycle- Overrides:
startin classUnsynchronizedAppenderBase<E>
-
getConnectionSource
- Returns:
- Returns the connectionSource.
-
setConnectionSource
- Parameters:
connectionSource- The connectionSource to set.
-
append
- Specified by:
appendin classUnsynchronizedAppenderBase<E>
-
subAppend
protected abstract void subAppend(E eventObject, Connection connection, PreparedStatement statement) throws Throwable- Throws:
Throwable
-
secondarySubAppend
protected abstract void secondarySubAppend(E eventObject, Connection connection, long eventId) throws Throwable- Throws:
Throwable
-
selectEventId
protected long selectEventId(PreparedStatement insertStatement, Connection connection) throws SQLException, InvocationTargetException -
stop
public void stop()- Specified by:
stopin interfaceLifeCycle- Overrides:
stopin classUnsynchronizedAppenderBase<E>
-