In my logcat there is too much output, so I'd like to filter it using some keywords, basically displaying only the output containing the keyword(s). Is there a way to do that in Android Studio through the UI?
-
possible duplicate of [Filter LogCat to get only the messages from My Application in Android?](http://stackoverflow.com/questions/6854127/filter-logcat-to-get-only-the-messages-from-my-application-in-android) – Ismail Sahin Nov 12 '13 at 14:44
-
no, I'm asking how to filter the messages by keyword. – Alessandro Roaro Nov 16 '13 at 10:59
-
as from android studio ver 0.4.5 you will get messages from the app that is running only. `Log cat has a new option (on by default) which creates an application filter automatically such that only the launched application's output is shown` – dmSherazi Feb 16 '14 at 09:25
11 Answers

- 1,580
- 2
- 13
- 14
-
12
-
8
-
2Only this solve my flood by genymotion on Android Studio logcat, thanks. – Florida Jul 20 '16 at 22:15
-
3
-
-
1ok got it :-D (just double click on green colored entry with text: "n internal calls") – Aydin K. Jul 31 '16 at 20:17
-
1@Aydin K. This can be reverted by selecting the pattern and pressing the "-" button. – HopefullyHelpful Sep 12 '16 at 15:04
-
-
For me, this produces lots of "I/chatty ... identical N lines". I solved that problem by adding a filter config which filters by logtag regex: ^(?!.*chatty).*$ and by my package name – m.reiter Feb 10 '21 at 08:27
-
There are two ways to do this, both are in the Android tab at the bottom of the IDE (where the logcat output is displayed).
First, you can simply type something into the search box at the top and it should filter only messages containing the text you type.
Second, you can do advanced filtering by clicking on the dropdown at the top right, which should be displaying No Filters by default, and choose Edit Filter Configuration
and specifying what to filter on. Using this method you also save the filters and can re-use them by selecting them in the dropdown.
Screenshot:

- 18,729
- 7
- 52
- 51
-
1Thanks for you answer. I had already tried the first one, but it doesn't filter out the non-relevant output. Re: the second option, unfortunatly I can't see the dropdown menu, what version are you using? – Alessandro Roaro Nov 14 '13 at 09:35
-
1
-
1I just noticed this while doing the screenshot, there is YET another way to filter. On the **left** side (right next to the tabs) is an icon with green arrows - it can be toggled on/off to display only logcat from the process selected in the list :) – free3dom Nov 14 '13 at 13:31
-
-
No problem! I suppose it was added in v0.3.3/4 then. Android Studio is getting better with each version :) – free3dom Nov 16 '13 at 15:54
-
-
I only see those buttons when debugging, what if I wanna filter the log while running the app but not debugging it? The search does not help much but to highlight the results. What I want is a filter like the DMS Monitor has. Is it possible to do it from inside Android Studio? (I am using 0.5.8 version) – Chiara May 12 '14 at 07:43
-
Thanks. UI Fail!That needs to be more obvious - a filter textbox needs to be up there - like eclipse – Gishu Dec 22 '14 at 13:37
-
Even though AS now displays only message specifically to the app, so much of the app messages are meaningless. Wish AS was more like Xcode and showed the messages you specify, errors, etc. that was really relevant. I see lots of messages like "Tagging socket 98 with tag 3000110100000000{805310721,0} uid -1, pid: 14922, getuid(): 10005" in AS and I haven't any idea what it is nor why I see such. This sort of stuff I think should be filtered out. Having to actually look/search for messages I put in is troublesome. AS should look how Xcode does it. – Micah Montoya Jan 12 '17 at 12:50
As @free3dom said you can select the process from which you want to receive logcats. Here is the screenshot.

- 3,743
- 5
- 37
- 62
-
2Thanks for adding this. It's good to have it here for everyone and I only mentioned it in the comments :) – free3dom Nov 26 '13 at 23:57
-
41
-
1as from android studio ver 0.4.5 u will get messages from the app that is running only. `Log cat has a new option (on by default) which creates an application filter automatically such that only the launched application's output is shown` – dmSherazi Feb 16 '14 at 09:24
-
1
-
I have one another problem, when i apply filter from filter configuration, for a particular package, logcat becomes blank. – Bhupesh Feb 25 '15 at 11:57
I MADE A VIDEO TUTORIAL TO SHOW YOU HOW= https://youtu.be/xw2qE5ko_9I
Give your log a name. I called mine "wawa".
In Android Studio, go to Android-> Edit Filter Configurations
Then type in the name you gave the logs. In my case, it's called "wawa". Here are some examples of the types of filters you can do. You can filter by System.out, System.err, Logs, or package names:

- 10,819
- 1
- 66
- 58
-
2Is there a regex to negate this, in order to hide the logs that contain a line? – Hugo M. Zuleta Nov 22 '16 at 18:49
-
Not that I know of. If you want to use regex, I think the best way is to adb into the Android OS and use Grep on the Bash Terminal. – Gene May 18 '18 at 22:50
-
^(?!chromium)(?!WebViewFactory)(?!zygote) .... add tags like these you want to hide like (?!TAG_NAME). If you want to use regex for a tag, eg. you want to hide all tags starts with "asd", then you add (?!(^asd)) to this "list" of tags. – Drusantia Jun 06 '18 at 12:49
First declare your TAG names in your code e.g.
private static final String TAG = "MainTagName";
Then add log statements where you want to output something
Log.d(TAG, "Activity created");
As per free3dom in the second post, on the logcat tab click on the Filters dropdown and then Edit Filter Configuration.
In this example we are using by Log Tag (regex) option to display log messages for any of the three matching tag names using the pipe | separator (without spaces):
MainTagName|SomeTagName|SomeOtherTagName
-
2I don't get any logcat output when using the | to separate the two tags (Android Studio 1.2) – Someone Somewhere May 12 '15 at 18:52
-
2@SomeoneSomewhere Ensure that your TAG's name matches the first parameter in the Log statement. Make sure there are no spaces between the tag names and pipe e.g. tag1|tag2. Be sure that you are in fact hitting the tag command by debugging your code. Check your log level is set to Debug or Verbose in the Log level drop down in the logcat window. – HostMyBus May 15 '15 at 00:05
-
2I tried all kinds of combinations. Mine failed because I had my filter with spaces and the | like "Tag1 | Tag2". Found this answer and removed spaces and it works perfectly. Thanks! – raddevus Feb 15 '16 at 18:49
see this https://medium.com/zinuzoid/if-you-developing-android-application-1bdff0a96205
just create LogCat filter a insert below String to "LogTag" which will then ignore system lines
^(?!.*(BtGatt|dalvik|Environment|DataRouter|FA|art|Wifi|ServiceManager|Atfwd|tnet|MDnsDS|Download|Bluetooth|slim|QSEECOMAPI|WVCdm|QC-time|sensors|nanohub|Drm|Babel|Dropbox|gsamlab|Cryptd|Vold|QC_|Conscrypt|Dns|sound|NetWork|OpenGL|TLog|GMPM|Microphone|Process|Dynamite|cr_|VideoCapabilities|libEGL))

- 1,053
- 10
- 18
-
Regex does not work anymore. Use -tag:UnWantedTag to exclude a tag instead. Use several to exclude more. – Thomas Williams May 19 '23 at 15:12
With AndroidStudio Dolphin a new logcat view mode was introduced providing a more structured view of the logcat output. It also introduced the new filtering options package:, tag: and level:. You can also search for the text in the whole entry by not preceding an option.
Quoting from Googles News post where the new logcat was introduced (https://androidstudio.googleblog.com/2022/03/android-studio-dolphin-canary-6-now.html) [Update] Proper Documentation is now available here https://developer.android.com/studio/debug/logcat
Specific values:
- package:<my-package-ID>
- tag:<my-tag>
- level:[VERBOSE | INFO | ASSERT | DEBUG | WARN | ERROR]
Exclude a specific value by preceding the key with -:
- -tag:<exclude-this-tag>
Use the regular expressions with a given key by placing a ~ after the key:
- tag~:<regular-expression-tag>
Combine with the exclude tag:
- -tag~:<exclude-this-regex-tag>
You can also see a history of queries by clicking the filter icon in the query field and selecting them from the drop down. To favorite a query so that it stays at the top of the list across all your studio projects, click the star icon at the end of the query field.
package:mine
matches all PIDs for the local app project.

- 4,075
- 1
- 18
- 22
One alternative that works for me is to select the Show only selected application
option in the filter menu:

- 26,627
- 26
- 120
- 132
-
Any idea when the "Firebase" option arrived? I saw it for the first time today (after spending an age wondering why my app was no longer logging). – Richard Le Mesurier Feb 14 '17 at 10:11
-
-
1Neither did I, but I had selected it (without knowing) and that wasted a lot of time. Thx anyway – Richard Le Mesurier Feb 15 '17 at 05:55
I don't know if the images in the other answer are old or if I was missing something, but here is an updated image.
Click the Android Monitor tab at the bottom and make sure the logcat tab is selected. Then type in whatever you want to filter your output. I filtered mine with my tag name TAG
.

- 484,302
- 314
- 1,365
- 1,393
Just to add my own mistake:
make sure that when you are using the Emulator and a real device, to switch to the device you are debugging in the dropdown on the left above the logcat tab.

- 897
- 10
- 16