2

When I watch android source code, I found

adb shell setprop log.tag.CAM2PORT_ VERBOSE 

This can output log in logcat. I want to know how to make all log tag output even if it is verbose.

I have tried

adb shell setprop log.tag.* VERBOSE  #It's not work

Thanks for your help

4
  • You could use the PackageManager to scan for all packages on your device to create a list, then loop around those setting the prop to verbose. But what is your usecase?
    – Blundell
    Jun 4, 2019 at 13:52
  • I want get all log even if it's verbose. There are many verbose log in my App,They have different tag.It's trouble to setprop.
    – Frank Fan
    Jun 11, 2019 at 3:06
  • You could look into how AndroidStudio does it, as that has a dropdown selector for verbose logs.
    – Blundell
    Jun 11, 2019 at 6:24
  • If a verbose log has not use 'adb shell setprop ' , It won't print.
    – Frank Fan
    Jun 18, 2019 at 6:45

2 Answers 2

1

You must set every tag you want to log. Regex like log.tag.* won't work. Like you said, not optimal if you are using different tags in your app.

You can try to use the local.prop file and define all your tags, probably easier than using adb shell setprop for every tag every time you want to enable logging.

You can also create a local.prop file that with the following in it: 'log.tag.=' and place that in /data/local.prop.

https://developer.android.com/reference/android/util/Log.html#isLoggable(java.lang.String,%20int)

1

In order to set a global minimum log level there is no need to configure tags individually. Just run

adb shell setprop persist.log.tag V

to enable all logs with any tag. Any supported Android priority can be set, so also DEBUG, INFO and others. The names can be specified in full, but only the first character is relevant. You can find more details here: https://medium.com/@mike_87757/set-android-minimum-log-level-globally-for-all-tags-4b1cbc1dc71f

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.