By default ADB(android debugable bridge) do not generate detailed log history of volley library. In order to get the detailed version of volley log, we need to perform following steps:
1.) Set tag to the volley
1 |
VolleyLog.setTag("Volley"); |
by default Volley tag is set to “Volley”. We can change to any depending on the developer comfort.
2. ) Set level of logging on our tag
1 |
Log.isLoggable("Volley", Log.VERBOSE); |
This will log the detailed information of logs generated by volley.
3.) Use the adb shell
command on your cmd/terminal to issue commands, with or without entering the adb remote shell on the emulator/device.
1 |
adb shell |
This will start a daemon to execute command.
if adb is not installed get adb tool for ubuntu via
1 2 |
sudo add-apt-repository ppa:phablet-team/tools && sudo apt-get update sudo apt-get install android-tools-adb android-tools-fastboot |
4.) use shell command to change logging level of your tag “Volley” in our case
1 |
setprop log.tag.Volley VERBOSE |
And you can get the detailed volley logs like:
1 2 3 4 5 6 7 8 |
08-02 19:50:46.231 19012-19012/com.webkul.mobikulMP D/Volley: [1] MarkerLog.finish: (+0 ) [ 1] add-to-queue 08-02 19:50:46.231 19012-19012/com.webkul.mobikulMP D/Volley: [1] MarkerLog.finish: (+0 ) [19844] cache-queue-take 08-02 19:50:46.231 19012-19012/com.webkul.mobikulMP D/Volley: [1] MarkerLog.finish: (+0 ) [19844] cache-miss 08-02 19:50:46.231 19012-19012/com.webkul.mobikulMP D/Volley: [1] MarkerLog.finish: (+0 ) [19847] network-queue-take 08-02 19:50:46.231 19012-19012/com.webkul.mobikulMP D/Volley: [1] MarkerLog.finish: (+2281) [19847] network-http-complete 08-02 19:50:46.231 19012-19012/com.webkul.mobikulMP D/Volley: [1] MarkerLog.finish: (+5 ) [19847] network-parse-complete 08-02 19:50:46.231 19012-19012/com.webkul.mobikulMP D/Volley: [1] MarkerLog.finish: (+0 ) [19847] post-response 08-02 19:50:46.231 19012-19012/com.webkul.mobikulMP D/Volley: [1] MarkerLog.finish: (+61 ) [ 1] done |
if you have multiple devices connected via adb execute shell command via:
1. ) list available devices: this will list all the available devices currently connected.
1 |
adb devices |
2.) start daemon on a particular device via:
1 |
adb -s 4200f20ed63d728d shell |
where number 4200f20ed63d728d is the device id on which we need to execute shell command.
For more info:
https://developer.android.com/reference/android/util/Log.html#isLoggable(java.lang.String, int)
https://developer.android.com/studio/command-line/shell.html
http://stackoverflow.com/questions/21378280/print-all-request-log-called-from-volley-library
http://lifehacker.com/the-easiest-way-to-install-androids-adb-and-fastboot-to-1586992378