Wednesday, November 30, 2011

Android LogCat filter in Eclipse

Very often during development we need to filter messages in LogCat View. Logcat Message Filter Settings already allow you to filter logs by Log Tag, Log Message, by PID, by Application Name and by Log Level. But sometimes it is not enough.

Fortunately log filter accepts Java regular expressions.
For example, to match only two tags we can use the following expression in Log Tag field:


Sometimes you need to exclude some messages from Logcat. In old ADT versions it could be done with creating new logcat filter when filtered messages were deleted from main log.
In ADT 15.0.1 such functionality was changed and filtered messages stay in main log.

And also Java regular expressions can help to get rid of annoying messages:
To exclude tag  “dalvikvm” from log:  (?!dalvikvm\b)\b\w+

DDMS LogCat still has some issues in spite of regular updates of ADT and SDK Tools. One of the most known is about small log buffer that requires to press “clear log” button periodically.

This issue and many others are solved in open source tool android-log-viewer developed by Mikhail Lopatkin:

  • Display logs from a device or an emulator
  • Display saved logs and dumpstate files
  • Search in the logs using regex if needed
  • Bookmarks
  • Filter log lines by tag, PID, log priority, message content
  • Filtered lines can be hidden, highlighted or shown in a separate window
  • Display any avaliable buffers: main, system, events, radio
  • Save filtered lines
  • Display process list


  1. Hi I'm trying to filter the dalvikvm-heap messages using the same method but I can't get it to work. Any ideas?

  2. To view the logcat output in Eclipse or AndroidStudio is sometimes a real hassle because of the huge number of logmessages passing by and when you filter in logcat you loose the filtered messages and cannot recall the these anymore. What I use is logcatUDP.apk and TailExpert. With logcatUDP you sent all logcat messages to TailExpert via wifi and in TailExpert you can filter the messages you don’t want to see. For logcatUDP you need a rooted phone but you can also use adb to write your logcat messages to a file and watch this file with TailExpert. Both TailExpert and logcatUDP are free for private use and you can download both logcatUDP and TailExpert at

    1. thanks, interestingly.
      I've mainly used android-log-viewer (, it does not require root and satisfies the most of my requirements.
      It seems TailExpert also could be very useful as it has some cool features.