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 boolean
protected boolean
protected ConnectionSource
protected SQLDialect
Fields inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase
name, started
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected abstract Method
protected abstract String
protected abstract void
secondarySubAppend(E eventObject, Connection connection, long eventId)
protected long
selectEventId(PreparedStatement insertStatement, Connection connection)
void
setConnectionSource(ConnectionSource connectionSource)
void
start()
void
stop()
protected abstract void
subAppend(E eventObject, Connection connection, PreparedStatement statement)
Methods inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, 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 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:
start
in interfaceLifeCycle
- Overrides:
start
in classUnsynchronizedAppenderBase<E>
-
getConnectionSource
- Returns:
- Returns the connectionSource.
-
setConnectionSource
- Parameters:
connectionSource
- The connectionSource to set.
-
append
- Specified by:
append
in 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:
stop
in interfaceLifeCycle
- Overrides:
stop
in classUnsynchronizedAppenderBase<E>
-