Buggy code:
public class DBAppender extends AppenderSkeleton { ConnectionSource connectionSource ; boolean cnxSupportsGetGeneratedKeys = false ; boolean cnxSupportsBatchUpdates = false ; SQLDialect sqlDialect ; boolean locationInfo = false ; static final String insertPropertiesSQL = "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>logging_event_property<seq2seq4repair_space>(event_id,<seq2seq4repair_space>mapped_key,<seq2seq4repair_space>mapped_value)<seq2seq4repair_space>VALUES<seq2seq4repair_space>(?,<seq2seq4repair_space>?,<seq2seq4repair_space>?)" ; static final String insertExceptionSQL = "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>logging_event_exception<seq2seq4repair_space>(event_id,<seq2seq4repair_space>i,<seq2seq4repair_space>trace_line)<seq2seq4repair_space>VALUES<seq2seq4repair_space>(?,<seq2seq4repair_space>?,<seq2seq4repair_space>?)" ; static final String insertSQL ; public DBAppender ( ) { } public void activateOptions ( ) { } public ConnectionSource getConnectionSource ( ) { } public void setConnectionSource ( ConnectionSource connectionSource ) { } protected void append ( LoggingEvent event ) { Connection connection = null ; try { connection = connectionSource . getConnection ( ) ; connection . setAutoCommit ( false ) ; PreparedStatement insertStatement = connection . prepareStatement ( DBAppender . insertSQL ) ; insertStatement . setLong ( 1 , event . getSequenceNumber ( ) ) ; insertStatement . setLong ( 2 , event . getTimeStamp ( ) ) ; insertStatement . setString ( 3 , event . getRenderedMessage ( ) ) ; insertStatement . setString ( 4 , event . getLoggerName ( ) ) ; insertStatement . setString ( 5 , event . getLevel ( ) . toString ( ) ) ; insertStatement . setString ( 6 , event . getNDC ( ) ) ; insertStatement . setString ( 7 , event . getThreadName ( ) ) ; insertStatement . setShort ( 8 , DBHelper . computeReferenceMask ( event ) ) ; LocationInfo li ; if ( ( event . locationInformationExists ( ) ) || ( locationInfo ) ) { li = event . getLocationInformation ( ) ; } else { li = LocationInfo . NA_LOCATION_INFO ; } insertStatement . setString ( 9 , li . getFileName ( ) ) ; insertStatement . setString ( 10 , li . getClassName ( ) ) ; insertStatement . setString ( 11 , li . getMethodName ( ) ) ; insertStatement . setString ( 12 , li . getLineNumber ( ) ) ; int updateCount = insertStatement . executeUpdate ( ) ; if ( updateCount != 1 ) { getLogger ( ) . warn ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>insert<seq2seq4repair_space>loggingEvent" ) ; } Statement idStatement = connection . createStatement ( ) ; idStatement . setMaxRows ( 1 ) ; ResultSet rs = null ; if ( cnxSupportsGetGeneratedKeys ) { rs = insertStatement . getGeneratedKeys ( ) ; } else { rs = idStatement . executeQuery ( sqlDialect . getSelectInsertId ( ) ) ; } rs . next ( ) ; int eventId = rs . getInt ( 1 ) ; insertStatement . close ( ) ; insertStatement = null ; Set propertiesKeys = event . getPropertyKeySet ( ) ; if ( ( propertiesKeys . size ( ) ) > 0 ) { PreparedStatement insertPropertiesStatement = connection . prepareStatement ( DBAppender . insertPropertiesSQL ) ; for ( Iterator i = propertiesKeys . iterator ( ) ; i . hasNext ( ) ; ) { String key = ( ( String ) ( i . next ( ) ) ) ; String value = ( ( String ) ( event . getProperty ( key ) ) ) ; insertPropertiesStatement . setInt ( 1 , eventId ) ; insertPropertiesStatement . setString ( 2 , key ) ; insertPropertiesStatement . setString ( 3 , value ) ; if ( cnxSupportsBatchUpdates ) { insertPropertiesStatement . addBatch ( ) ; } else { insertPropertiesStatement . execute ( ) ; } } if ( cnxSupportsBatchUpdates ) { insertPropertiesStatement . executeBatch ( ) ; } insertPropertiesStatement . close ( ) ; insertPropertiesStatement = null ; } String [ ] strRep = event . getThrowableStrRep ( ) ; if ( strRep != null ) { <START_BUG> getLogger ( ) . info ( "Logging<seq2seq4repair_space>an<seq2seq4repair_space>exception" ) ; <END_BUG> PreparedStatement insertExceptionStatement = connection . prepareStatement ( DBAppender . insertExceptionSQL ) ; for ( short i = 0 ; i < ( strRep . length ) ; i ++ ) { insertExceptionStatement . setInt ( 1 , eventId ) ; insertExceptionStatement . setShort ( 2 , i ) ; insertExceptionStatement . setString ( 3 , strRep [ i ] ) ; if ( cnxSupportsBatchUpdates ) { insertExceptionStatement . addBatch ( ) ; } else { insertExceptionStatement . execute ( ) ; } } if ( cnxSupportsBatchUpdates ) { insertExceptionStatement . executeBatch ( ) ; } insertExceptionStatement . close ( ) ; insertExceptionStatement = null ; } connection . commit ( ) ; } catch ( SQLException sqle ) { getLogger ( ) . error ( "problem<seq2seq4repair_space>appending<seq2seq4repair_space>event" , sqle ) ; } finally { DBHelper . closeConnection ( connection ) ; } } public void close ( ) { } public boolean requiresLayout ( ) { } public boolean getLocationInfo ( ) { } public void setLocationInfo ( boolean locationInfo ) { } }

Fix:
getLogger ( ) . debug ( "Logging<seq2seq4repair_space>an<seq2seq4repair_space>exception" ) ;