@Override
    @SuppressWarnings("Slf4jFormatShouldBeConst")
    protected void logException(long id, SQLException exception) {
        final String message = formatLogMessage(id, exception);
        for (Throwable throwable : exception) {
            logger.error(message, throwable);
        }
    }
@Test
    void testLogException() throws Exception {
        Logger logger = mock(Logger.class);
        LoggingSQLExceptionMapper sqlExceptionMapper = new LoggingSQLExceptionMapper(logger);

        RuntimeException runtimeException = new RuntimeException("DB is down");
        SQLException sqlException = new SQLException("DB error", runtimeException);
        sqlExceptionMapper.logException(4981, sqlException);

        verify(logger).error("Error handling a request: 0000000000001375", sqlException);
        verify(logger).error("Error handling a request: 0000000000001375", runtimeException);
    }