How to filter logcat in Android Studio?

Android StudioLogcat

Android Studio Problem Overview


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?

Android Studio Solutions


Solution 1 - Android Studio

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:
Search & Filter Logcat

Solution 2 - Android Studio

What I do is right click on a line I don't like and select "Fold lines like This"enter image description here

Solution 3 - Android Studio

As @free3dom said you can select the process from which you want to receive logcats. Here is the screenshot.

Screen Shot

Solution 4 - Android Studio

I MADE A VIDEO TUTORIAL TO SHOW YOU HOW= https://youtu.be/xw2qE5ko_9I

Give your log a name. I called mine "wawa".

enter image description here

In Android Studio, go to Android-> Edit Filter Configurations

enter image description here

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:

enter image description here enter image description here enter image description here

Solution 5 - Android Studio

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

Solution 6 - Android Studio

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))

Solution 7 - Android Studio

I had trouble turning on the filters in Logcat. To see the filters in Android Studio 3.2, you have to toggle 'Floating Mode' on and off again to make the filters reappear.

enter image description here

Solution 8 - Android Studio

One alternative that works for me is to select the Show only selected application option in the filter menu:

enter image description here

Solution 9 - Android Studio

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.

enter image description here

Solution 10 - Android Studio

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlessandro RoaroView Question on Stackoverflow
Solution 1 - Android Studiofree3domView Answer on Stackoverflow
Solution 2 - Android StudioJames HackettView Answer on Stackoverflow
Solution 3 - Android StudiodmSheraziView Answer on Stackoverflow
Solution 4 - Android StudioGeneView Answer on Stackoverflow
Solution 5 - Android StudioHostMyBusView Answer on Stackoverflow
Solution 6 - Android StudioJosef VancuraView Answer on Stackoverflow
Solution 7 - Android Studiolive-loveView Answer on Stackoverflow
Solution 8 - Android StudioOjonugwa Jude OchalifuView Answer on Stackoverflow
Solution 9 - Android StudioSuragchView Answer on Stackoverflow
Solution 10 - Android StudioDawiedView Answer on Stackoverflow