SpringBoot 2.6.0 中的项目工作,强制使用 Log4J1 和 JCL 重定向工作但 JUL 不工作

Project inside SpringBoot 2.6.0 working, forced to use Log4J1 and JCL redirect working but JUL not

我有一个项目,最新版本现在是 SpringBoot 2.6.0(旧版本是 WAR for Tomcat 8)。我有一个 sub-project/component 连接到迫使我使用 Log4J1 的东西。 Logback 工作得很好,但我不得不禁用它(由于 Log4J2 黯然失色并破坏了需要 Log4J1 的代码,还有一个新的供应商组件也需要 Log4J2)。

我已经:

  1. 通过排除 spring-boot-starter-logging
  2. 禁用了 Logback
  3. 添加了 spring-boot-starter-log4j
  4. 的依赖

通过 Dependency hierarchy 选项卡(在 Eclipse 中)我可以看到 jcl 和 jul 库,并且在我的日志(控制台和文件附加程序)中很明显 SpringBoot(jcl 东西)和我的任何项目 jcl 调用都被记录了,但任何 JUL 都不是。

我在这里阅读了大量不同的票证,收集了信息并得出了这一点。所以这一切都很好,除了我似乎无法将 JUL 调用传递给 Log4J1 设置。

我可以看到通过 spring-boot-starter-log4j 引入了 jul-to-slf4j。

我想我应该写在这里,因为我确信我错过了一些简单的东西,但我想我今天下午盯着它看了太久了! :)

我错过了什么?

        <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-log4j</artifactId>
        <version>1.3.8.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.32</version>
    </dependency>   
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.7.32</version>
    </dependency>   

我通过添加以下内容获得了 JUL 位管道:

SLF4JBridgeHandler.install();
java.util.logging.LogManager.getLogManager().getLogger("").setLevel( Level.INFO);

我在问题 JUL to SLF4J Bridge

上找到的