I'm trying to get the SQL statement after the variables are included using the log4jdbc framework. So far it catches and prints out the needed information, but also some stuff that I don't need:
11.06.2011 10:49:40 net.sf.log4jdbc.Slf4jSpyLogDelegator connectionOpened
INFO: 1. Connection opened
11.06.2011 10:49:40 net.sf.log4jdbc.Slf4jSpyLogDelegator methodReturned
INFO: 1. Connection.new Connection returned
11.06.2011 10:49:40 net.sf.log4jdbc.Slf4jSpyLogDelegator methodReturned
INFO: 1. PreparedStatement.new PreparedStatement returned
11.06.2011 10:49:40 net.sf.log4jdbc.Slf4jSpyLogDelegator methodReturned
INFO: 1. Connection.prepareStatement(INSERT INTO `xxx` (`y`, `y`, `y`, `y`, `y`, `y`) VALUES (NOW(), ?, ?, ?, ?, ?, ?) ) returned net.sf.log4jdbc.PreparedStatementSpy@13043d2
11.06.2011 10:49:40 net.sf.log4jdbc.Slf4jSpyLogDelegator methodReturned
INFO: 1. PreparedStatement.setInt(1, 0) returned
11.06.2011 10:49:40 net.sf.log4jdbc.Slf4jSpyLogDelegator methodReturned
INFO: 1. PreparedStatement.setInt(2, 2) returned
11.06.2011 10:49:40 net.sf.log4jdbc.Slf4jSpyLogDelegator methodReturned
INFO: 1. PreparedStatement.setLong(3, 1426656) returned
11.06.2011 10:49:40 net.sf.log4jdbc.Slf4jSpyLogDelegator methodReturned
INFO: 1. PreparedStatement.setLong(4, 5177344) returned
11.06.2011 10:49:40 net.sf.log4jdbc.Slf4jSpyLogDelegator methodReturned
INFO: 1. PreparedStatement.setInt(5, 12) returned
11.06.2011 10:49:40 net.sf.log4jdbc.Slf4jSpyLogDelegator methodReturned
INFO: 1. PreparedStatement.setInt(6, 1) returned
2011-06-11 10:49:40,993;net.sf.log4jdbc.PreparedStatementSpy@13043d2;
11.06.2011 10:49:40 net.sf.log4jdbc.Slf4jSpyLogDelegator sqlOccured
INFO: INSERT INTO `xxx` (`y`, y`, `y`, `y`, `y`, `y`, `y`) VALUES (NOW(), 0, 2, 1426656, 5177344, 12, 1)
How can I filter the entries and only show the actual, last, entry?