13

I'm trying to use LogCat in Android Studio 2.2.2 in some debugging but my Logcat runs like a firehose and and there's too much content to see.

In Android Monitor when the LogCat tab is selected there's a dropdown where one of the choices is "Show only selected application" so I selected that but it didn't seem to have any effect. My LogCat runs like a firehose even when I'm disconnected from my debug target. So what does "Show only selected application" do and how can I tell what the "selected application" is?

yoAlex5
  • 29,217
  • 8
  • 193
  • 205
user316117
  • 7,971
  • 20
  • 83
  • 158

5 Answers5

10

The following works on Android Studio 3.4: Use the Logcat filter dropdown at the top right of the Logcat panel. Select "Edit Filter Configuration".

  • Enter your package name in the "Package Name" field.
  • Enter something meaningful to you in the "Filter Name" field (I used my package name again).

Your new filter will now appear in the Logcat filter dropdown, and when selected will show only messages from your package.

Example filter configuration

Norbert Bartko
  • 2,468
  • 1
  • 17
  • 36
AngusTS
  • 101
  • 1
  • 5
7

You should enable ADB integration (it's disabled by default now): Tools->Android->Enable ADB integration.

Then you'll be able to see your debuggable processes in the dropdown on the left.

P1x
  • 1,690
  • 1
  • 19
  • 24
2

Set tag for every log and then filter logs for that specific tag

Log.d("TAG","Application logs");

Edit Filter configuration and add your tag. Then you will only see your application logs

enter image description here

Happy Coding!!

Sahil Mahajan
  • 3,922
  • 2
  • 29
  • 43
  • 1
    I'm sorry, but this doesn't seem to be an answer to the question I asked. (also I have no control over the LogCat statements in the code I'm interested in looking at) – user316117 Nov 17 '16 at 18:08
  • Logcat will show logs of all the android libraries/frameworks that device is using at that time. There are lot of services running so thats why logcat print a lot of logs including wifi, ble logs etc etc. Selected application is the process you are debugging or running through the android studio. Ideally it shoud not show "selected application" if there is no phone or process attached to studio. – Sahil Mahajan Nov 17 '16 at 18:22
  • I didn't read the whole question, I thought u are asking how to get rid of all the unnecessary logs. Apologies for ur disappointment, may be this answer can help other noobs who dont know this approach. – Sahil Mahajan Nov 17 '16 at 18:26
  • In a sense I AM asking how to get rid of the the unnecessary logs, because the unnecessary logs are the ones not related to my application. I ONLY want to see logs related to my application. How do I tell which application Android Studio thinks is the "selected" one? If I go to the Run menu, "Run app" and "Debug app" are both enabled and "Stop" is **dis**abled, so I don't think that Android Studio thinks any app is running. Also, for the attached device Android Monitor says (in red) No Debuggable Processes. – user316117 Nov 17 '16 at 20:52
  • From where to open this window? – Jaimin Modi Feb 10 '23 at 07:06
1

Inside the logcat filter box you can write directly:

enter image description here

That shows only all the events of your app.

Guillermo
  • 159
  • 1
  • 3
0

Also you can try PID Cat from Jake Wharton to color logs for specyfic process

[Read more here]

yoAlex5
  • 29,217
  • 8
  • 193
  • 205