码迷,mamicode.com
首页 > 编程语言 > 详细

springboot中logback和log4j冲突,保留log4j

时间:2020-01-29 23:11:27      阅读:270      评论:0      收藏:0      [点我收藏+]

标签:depend   tar   web   冲突   pre   group   star   除了   framework   

首先在spring-boot-starter-web中排除spring-boot-starter这个包
然后在spring-boot-starter中排除spring-boot-starter-logging包,此时logback包就被排除了.因为logbak包的上一级parent为spring-boot-starter包

<!--排除spring-boot-starter-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <!-- 去除旧log依赖 -->
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!--引入spring-boot-starter,排除spring-boot-starter-logging-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

springboot中logback和log4j冲突,保留log4j

标签:depend   tar   web   冲突   pre   group   star   除了   framework   

原文地址:https://www.cnblogs.com/eternityz/p/12241592.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!