java - LoggerFactory 不是 Logback LoggerContext 但 Logback 在类路径上

标签 java logging spring-security spring-boot dependency-management

我认为 spring-boot-starter-security 中的某些模块与 log4j 冲突,但我不知道是哪个。

我的gradle依赖如下:

compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile("org.springframework.boot:spring-boot-starter-security"){
    exclude module: "spring-boot-starter-logging"
}

compile "org.apache.logging.log4j:log4j-api"
compile "org.apache.logging.log4j:log4j-core"
compile "org.apache.logging.log4j:log4j-slf4j-impl"
compile('org.apache.poi:poi:3.10.1')
compile('org.apache.poi:poi-ooxml:3.10.1')
testCompile("junit:junit")

最佳答案

maven 的相同解决方案:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
    <version>1.5.1.RELEASE</version>
    <exclusions>
        <exclusion>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </exclusion>
    </exclusions>
</dependency>

关于java - LoggerFactory 不是 Logback LoggerContext 但 Logback 在类路径上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30792268/

相关文章:

Java "Illegal key size",尽管已安装 JCE 无限强度管辖权策略文件

java - 在 Windows 上从命令行下载最新的 Java SE Runtime Environment 8

java - Log4j V2 自定义布局

c - 使用 MCU-ATMega 1280 进行多中断实时数据记录

java - 'WEB-INF/classes/logging.properties' 中指定的 FileHandler 被额外记录污染

spring - 我如何加密密码将其插入数据库并在比较后何时连接?

grails - 自定义新的 Grails Spring Security Core Plugin 登录页面

java - 无法使用java将数据从服务器发送到客户端,反之亦然

spring-security - Spring Security SAML 可信证书条目不受密码保护

Java 大页面和详细 GC header