解决httpClient在控制台打印Debug日志

解决httpClient在控制台打印Debug日志

问题:httpclient在运行或者调试中会在控制台一直打印日志如下代码:

21:57:41.413 [main] DEBUG org.apache.http.wire - << "                                   [\r][\n]"
21:57:41.413 [main] DEBUG org.apache.http.wire - << "[\r][\n]"
21:57:41.413 [main] DEBUG org.apache.http.wire - << "                                   [\r][\n]"
21:57:41.413 [main] DEBUG org.apache.http.wire - << "                               [\n]"
21:57:41.413 [main] DEBUG org.apache.http.wire - << "    [\n]"
21:57:41.424 [main] DEBUG org.apache.http.wire - << "[\n]"
21:57:41.425 [main] DEBUG org.apache.http.wire - << "[\r][\n]"
21:57:41.425 [main] DEBUG org.apache.http.wire - << "[\r][\n]"
21:57:41.425 [main] DEBUG org.apache.http.wire - << "                   
[\r][\n]" 21:57:41.425 [main] DEBUG org.apache.http.wire - << " [\r][\n]" 21:57:41.425 [main] DEBUG org.apache.http.wire - << " [\r][\n]" 21:57:41.425 [main] DEBUG org.apache.http.wire - << " [\r][\n]" 21:57:41.433 [main] DEBUG org.apache.http.wire - << " [\n]" 21:57:41.433 [main] DEBUG org.apache.http.wire - << "
[\n]" 21:57:41.433 [main] DEBUG org.apache.http.wire - << "[\n]" 21:57:41.433 [main] DEBUG org.apache.http.wire - << "
[\n]" 21:57:41.433 [main] DEBUG org.apache.http.wire - << "[\n]" 21:57:41.433 [main] DEBUG org.apache.http.wire - << "[\n]" 21:57:41.433 [main] DEBUG org.apache.http.wire - << "[\n]" 21:57:41.433 [main] DEBUG org.apache.http.wire - << "[\n]" 21:57:41.433 [main] DEBUG org.apache.http.wire - << "
[\n]" 21:57:41.442 [main] DEBUG org.apache.http.wire - << "[\n]" 21:57:41.443 [main] DEBUG org.apache.http.wire - << "[\n]" 21:57:41.443 [main] DEBUG org.apache.http.wire - << "
[\n] " 21:57:41.443 [main] DEBUG org.apache.http.wire - << "
[\n]" 21:57:41.443 [main] DEBUG org.apache.http.wire - << "[\n]" 21:57:41.443 [main] DEBUG org.apache.http.wire - << "
[\n]" 21:57:41.443 [main] DEBUG org.apache.http.wire - << "
[\n]" 21:57:41.443 [main] DEBUG org.apache.http.wire - << "[\n]" 21:57:41.455 [main] DEBUG org.apache.http.wire - << "[\n]" 21:57:41.455 [main] DEBUG org.apache.http.wire - << "
[\n]" 21:57:41.455 [main] DEBUG org.apache.http.wire - << "[\n]" 21:57:41.455 [main] DEBUG org.apache.http.wire - << "
[\n]" 21:57:41.455 [main] DEBUG org.apache.http.wire - << "
[\n]" 21:57:41.455 [main] DEBUG org.apache.http.wire - << "[\n]"

第一种情况:创建logback.xml


    
    

第二种情况:如果用了log4j2。在log4j2.xml加入下面的代码。

    
    
        
    
    
        
    
    
        
    

三:如果引入了Report Portal,在log4j2.xml加入以下代码

    
    
        
        
    
    
        
        
    
    
        
        
    
    
        
        
    

你可能感兴趣的:(解决httpClient在控制台打印Debug日志)