### Question:
ConfiguredQueryLogger implements QueryLogger { @Override public void failure( ExecutingQuery query, Throwable failure ) { log.error( logEntry( query.snapshot() ), failure ); } ConfiguredQueryLogger( Log log, Config config ); @Override void failure( ExecutingQuery query, Throwable failure ); @Override void failure( ExecutingQuery query, String reason ); @Override void success( ExecutingQuery query );  }### Answer:
@Test public void shouldLogQueryOnFailureEvenIfFasterThanThreshold() { final AssertableLogProvider logProvider = new AssertableLogProvider(); ExecutingQuery query = query( SESSION_1, "TestUser", QUERY_1 ); ConfiguredQueryLogger queryLogger = queryLogger( logProvider ); RuntimeException failure = new RuntimeException(); clock.forward( 1, TimeUnit.MILLISECONDS ); queryLogger.failure( query, failure ); logProvider.assertExactly( inLog( getClass() ) .error( is( "1 ms: " + sessionConnectionDetails( SESSION_1, "TestUser" ) + " - MATCH (n) RETURN n - {}" ), sameInstance( failure ) ) ); }
@Test public void shouldLogQueryParametersOnFailure() { final AssertableLogProvider logProvider = new AssertableLogProvider(); Map<String,Object> params = new HashMap<>(); params.put( "ages", Arrays.asList( 41, 42, 43 ) ); ExecutingQuery query = query( SESSION_1, "TestUser", QUERY_4, params, emptyMap() ); ConfiguredQueryLogger queryLogger = queryLogger( logProvider, Config.defaults( GraphDatabaseSettings.log_queries_parameter_logging_enabled, "true" ) ); RuntimeException failure = new RuntimeException(); clock.forward( 1, TimeUnit.MILLISECONDS ); queryLogger.failure( query, failure ); logProvider.assertExactly( inLog( getClass() ).error( is( "1 ms: " + sessionConnectionDetails( SESSION_1, "TestUser" ) + " - MATCH (n) WHERE n.age IN {ages} RETURN n - {ages: [41, 42, 43]} - {}" ), sameInstance( failure ) ) ); }