How to enable logging for apache commons HttpClient on Android

java.util.logging.Logger.getLogger("org.apache.http.wire").setLevel(java.util.logging.Level.FINEST);
java.util.logging.Logger.getLogger("org.apache.http.headers").setLevel(java.util.logging.Level.FINEST);

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.httpclient.wire", "debug");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http", "debug");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.headers", "debug");

 

adb shell setprop log.tag.org.apache.http VERBOSE
adb shell setprop log.tag.org.apache.http.wire VERBOSE
adb shell setprop log.tag.org.apache.http.headers VERBOSE
 

http://stackoverflow.com/questions/3246792/how-to-enable-logging-for-apache-commons-httpclient-on-android/

 

下面的两个文件都是如此使用的:

http://code.google.com/p/wwwjdic/source/browse/trunk/wwwjdic/src/org/nick/wwwjdic/EntityBasedHttpClient.java?spec=svn417&r=417

http://code.google.com/p/fanfoudroid/source/browse/src/com/ch_linghu/fanfoudroid/http/HttpClient.java?r=61b65734ece2a5089a087cc4aa4e7230d00fbef4

你可能感兴趣的:(java,apache,android)