Buggy code:
public class DBAppender extends AppenderSkeleton { ConnectionSource connectionSource ; SQLDialect sqlDialect ; public void activateOptions ( ) { } public ConnectionSource getConnectionSource ( ) { } public void setConnectionSource ( ConnectionSource connectionSource ) { } protected void append ( LoggingEvent event ) { try { Connection connection = connectionSource . getConnection ( ) ; connection . setAutoCommit ( false ) ; StringBuffer sql = new StringBuffer ( ) ; sql . append ( "INSERT<seq2seq4repair_space>INTO<seq2seq4repair_space>logging_event<seq2seq4repair_space>(" ) ; sql . append ( "sequence_number,<seq2seq4repair_space>timestamp,<seq2seq4repair_space>rendered_message,<seq2seq4repair_space>" ) ; sql . append ( "logger_name,<seq2seq4repair_space>level_string,<seq2seq4repair_space>ndc,<seq2seq4repair_space>thread_name,<seq2seq4repair_space>reference_flag)<seq2seq4repair_space>" ) ; sql . append ( "<seq2seq4repair_space>VALUES<seq2seq4repair_space>(?,<seq2seq4repair_space>?,<seq2seq4repair_space>?<seq2seq4repair_space>,?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?,<seq2seq4repair_space>?)" ) ; PreparedStatement insertStatement = connection . prepareStatement ( sql . toString ( ) ) ; 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 ) ) ; int updateCount = insertStatement . executeUpdate ( ) ; if ( updateCount != 1 ) { LogLog . warn ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>insert<seq2seq4repair_space>loggingEvent" ) ; } Statement idStatement = connection . createStatement ( ) ; idStatement . setMaxRows ( 1 ) ; ResultSet rs = idStatement . executeQuery ( sqlDialect . getSelectInsertId ( ) ) ; rs . first ( ) ; int eventId = rs . getInt ( 1 ) ; Set propertiesKeys = event . getPropertyKeySet ( ) ; if ( ( propertiesKeys . size ( ) ) > 0 ) { 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>?)" ; PreparedStatement insertPropertiesStatement = connection . prepareStatement ( insertPropertiesSQL ) ; for ( Iterator i = propertiesKeys . iterator ( ) ; i . hasNext ( ) ; ) { String key = ( ( String ) ( i . next ( ) ) ) ; String value = ( ( String ) ( event . getProperty ( key ) ) ) ; <START_BUG> LogLog . debug ( ( ( ( ( ( "id<seq2seq4repair_space>" + eventId ) + ",<seq2seq4repair_space>key<seq2seq4repair_space>" ) + key ) + ",<seq2seq4repair_space>value<seq2seq4repair_space>" ) + value ) ) ; <END_BUG> insertPropertiesStatement . setInt ( 1 , eventId ) ; insertPropertiesStatement . setString ( 2 , key ) ; insertPropertiesStatement . setString ( 3 , value ) ; insertPropertiesStatement . addBatch ( ) ; } insertPropertiesStatement . executeBatch ( ) ; } String [ ] strRep = event . getThrowableStrRep ( ) ; if ( strRep != null ) { LogLog . info ( "Logging<seq2seq4repair_space>an<seq2seq4repair_space>exception" ) ; 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>?)" ; PreparedStatement insertExceptionStatement = connection . prepareStatement ( insertExceptionSQL ) ; for ( short i = 0 ; i < ( strRep . length ) ; i ++ ) { insertExceptionStatement . setInt ( 1 , eventId ) ; insertExceptionStatement . setShort ( 2 , i ) ; insertExceptionStatement . setString ( 3 , strRep [ i ] ) ; insertExceptionStatement . addBatch ( ) ; } insertExceptionStatement . executeBatch ( ) ; } connection . commit ( ) ; } catch ( SQLException sqle ) { LogLog . error ( "problem<seq2seq4repair_space>appending<seq2seq4repair_space>event" , sqle ) ; } } public void close ( ) { } public boolean requiresLayout ( ) { } }

Fix:
LogLog . info ( ( ( ( ( ( "id<seq2seq4repair_space>" + eventId ) + ",<seq2seq4repair_space>key<seq2seq4repair_space>" ) + key ) + ",<seq2seq4repair_space>value<seq2seq4repair_space>" ) + value ) ) ;