关闭使用httpclient中过多日志

在使用httpclient建立http连接的过程中,默认记录的日志相当的多。在官网上看了看。最后需要在开始的时候设置系统的属性才可以关闭。具体要加入以下语句。
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "stdout");
参考文档:http://hc.apache.org/httpclient-3.x/logging.html

你可能感兴趣的:(java开发相关)