Flyway JdbcTemplate异常日志记录

时间:2013-07-11 10:48:43

标签: flyway

如何让Flyway输出java migrator中发生的异常的堆栈跟踪?

显然我不能。

    private Pair<Boolean, MigrationVersion> applyMigration(final ResolvedMigration migration, boolean isOutOfOrder) throws FlywayException {
    ...
    } catch (Exception e) {
        LOG.error(e.toString());

        @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"})
        Throwable rootCause = ExceptionUtils.getRootCause(e);
        if (rootCause != null) {
            LOG.error("Caused by " + rootCause.toString());
        }
    }

吞下堆栈跟踪,这使得重要信息(例如异常的行号)消失。

有没有改变这种行为的计划?

0 个答案:

没有答案
相关问题