pom里面不要logback_在SpringBoot中禁用Logback-问答-阿里云开发者社区-阿里云

问题描述: LoggerFactory 不是Logback 的LoggerContext,但是Logback却会在classpath上。需要禁用掉Logback,猜测是pom中的引用出现了问题

原来的pom文件如下:

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0

spring-boot-starter-parent

org.springframework.boot

1.0.1.RELEASE

com.fe

cloudapp

1.0.0

Withinet-PaaS

Develop your web applications in on our infrastructure and we will worry about administration and scalability of your app.

1.7

16.0.1

UTF-8

UTF-8

com.sun.jersey

jersey-client

1.8

com.withinet.cloudapp

slave

1.0.0

org.apache.wicket

wicket-core

6.15.0

org.hibernate

hibernate-core

4.3.0.Final

com.google.code.gson

gson

2.2.4

org.springframework.boot

spring-boot-starter

org.springframework.boot

spring-boot-starter-test

test

org.springframework.boot

spring-boot-starter-web

javax.validation

validation-api

1.1.0.Final

org.hibernate

hibernate-validator-annotation-processor

4.1.0.Final

com.google.guava

guava

${guava.version}

javax.inject

javax.inject

1

org.apache.lucene

lucene-queryparser

4.8.0

org.springframework.boot

spring-boot-starter-tomcat

provided

org.springframework.boot

spring-boot-maven-plugin

com.withinet.cloud.Application

JAR

repackage

解决方法如下:

需要手动地解除spring-boot-starter和spring-boot-starter-web中的那些logging。需要将pom文件中的上述两项进行如下改造:

org.springframework.boot

spring-boot-starter

org.springframework.boot

spring-boot-starter-logging

org.springframework.boot

spring-boot-starter-web

org.springframework.boot

spring-boot-starter-logging

这样就解决了冲突问题啦!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值