首页 > 解决方案 > 为什么springboot启动时会清除旧的日志配置

问题描述

有一个遗留应用程序使用 JUL 并通过代码注册处理程序。现在我在旧版应用程序中使用 springboot。

我尝试了最小的spring boot依赖,它只包括spring-boot-starter,不包括spring-boot-starter-logging;在 application.properties 中将 org.springframework.boot.logging.LoggingSystem 设置为 none;使用 commons-logging 或 jcl-over-slf4j。并且 JUL 配置总是在 spring boot 启动时被清除。

有没有办法在 spring boot 启动时保持 JUL 配置不变?

spring boot 版本为 1.5.20,因为 legacy app 是用 java7 编译的

标签: javaspring-bootslf4j

解决方案


this link partially answers the question

However, still not sure the mechanism of Logger initialization of Spring Boot


推荐阅读