// wrap the SqlSessionFactory using a statement logger
StatementLogSqlSessionFactory wrappedSessionFactory = new StatementLogSqlSessionFactory(sqlSessionFactory);
processEngineConfiguration.setSqlSessionFactory(wrappedSessionFactory);
// replace the sqlSessionFacorty used by the DbSqlSessionFactory as well
DbSqlSessionFactory dbSqlSessionFactory = processEngineConfiguration.getDbSqlSessionFactory();
dbSqlSessionFactory.setSqlSessionFactory(wrappedSessionFactory);
}