【SpringBoot】关闭HttpClient无用日志

环境:

SpringBoot

pom依赖了apache.commons.HttpClient:



commons-httpclient
commons-httpclient
3.1

问题:

调用httpClient时会输出一堆相关的debug日志。

解决:

官方提供了log4j、Commons Logging、java.util.logging三种日志关闭的方法,但是没有提供SLF4J日志的关闭方法,方法如下:

在classpath下(resources目录下)建立一个logback.xml,内容如下:





posted @ 2017-08-21 16:07  puyangsky  阅读(3965)  评论(0)    收藏  举报