如何在Spring Boot 2.5.3中设置liquidbase日志?



我的项目中有最新的spring boot和liqubase,其版本由spring boot父工件提供。我更喜欢默认的logback。当我将其构建为jar时,其日志记录工作正常。

INFO liquibase.logging.core.JavaLogger Successfully acquired change log lock
INFO liquibase.logging.core.JavaLogger Reading from public.databasechangelog
INFO liquibase.logging.core.JavaLogger Successfully released change log lock
INFO liquibase.logging.core.JavaLogger Successfully acquired change log lock
WARN liquibase.logging.core.JavaLogger Skipping auto-registration
INFO liquibase.logging.core.JavaLogger Successfully released change log lock

但是,如果它被构建为war并部署到Apache Tomcat 9.0.50,它不使用logback并将日志保存到Tomcat -stderr文件。

INFO [main] liquibase.lockservice.null Successfully acquired change log lock
INFO [main] liquibase.changelog.null Reading from public.databasechangelog
INFO [main] liquibase.lockservice.null Successfully released change log lock
INFO [main] liquibase.lockservice.null Successfully acquired change log lock
WARNING [main] liquibase.hub.null Skipping auto-registration

我将liqubase版本降级为3.10,它可以作为战争使用。我注意到它使用了不同的类。看一看

INFO liquibase.logging.core.Slf4jLogger Successfully acquired change log lock

在Liquibase 4.0中,我们将使用SLF4J日志记录的代码更改为默认使用java.util.Logging。

但是,在https://github.com/mattbertolini/liquibase-slf4j上有一个扩展,它将Liquibase切换回使用SLF4j进行日志记录

相关内容

  • 没有找到相关文章

最新更新