How to make java.util.logging send logs to Logback?

别来无恙 提交于 2019-12-01 04:12:51

Your application needs to have the following jars:

Application -> Freemarker -> java.util.logging -> SLF4J Api: jul-to-slf4j.jar

Application -> SLF4J API: slf4j-api.jar

SLF4J API -> logback: logback-classic.jar and logback-core.jar

Since your application already contains slf4j-api.jar and logback-classic.jar, you probably only have to add the jul-to-slf4j.jar

If you use maven:

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>jul-to-slf4j</artifactId>
    <version>1.7.22</version>
</dependency>

<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
    <version>1.1.8</version>
</dependency>

logback classic will transitively add logback-core and slf4j-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!