Từ một câu trả lời trên StackOverflow. Điều này có thể dễ dàng được thực hiện bằng cách cho phép gỡ lỗi đăng nhập cho Client Apache HTTP:
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");
Nguồn
2012-09-12 05:38:04
Tôi đã chèn mã này, nhưng tôi không nhận được thêm đăng nhập nào từ điều này. Có điều gì khác mà tôi phải làm để làm việc này không. – Radon8472
Chúng ta có nên đặt nó trong một thuộc tính gradle? T____T – Isabelle