SpringBootjava
pom依賴了apache.commons.HttpClient:spring
<!--httpclient--> <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>3.1</version> </dependency>
調用httpClient時會輸出一堆相關的debug日誌。apache
官方提供了log4j、Commons Logging、java.util.logging三種日誌關閉的方法,可是沒有提供SLF4J日誌的關閉方法,方法以下:spa
在classpath下(resources目錄下)創建一個logback.xml,內容以下:debug
<?xml version="1.0" encoding="UTF-8"?> <configuration> <include resource="org/springframework/boot/logging/logback/base.xml" /> <logger name="*" level="warn" /> </configuration>