85

I am getting lots of this kind of logcat messages related to my application.

11-19 19:04:23.872 3327 3440 I chatty : uid=10085 com.xxxx.yyy expire 18 lines

What are these log messages? Am I missing my actual application logcat logs here?

AndRSoid
  • 1,777
  • 2
  • 13
  • 25
  • I'm getting these as well, and although my application is working fine, I would love to know what they indicate. Something to do with logging, I'm guessing? `01-22 16:04:14.256 2398 2398 I chatty : uid=10126(be.xxx.yyyyyyyyyy) expire 11 lines` – Fugue Jan 22 '16 at 15:18

5 Answers5

86

I want to add another answer because none of the existing answers actually answered the 'Am I missing my actual application logcat logs here?' question.

Yes, you're missing the logs. As soon as app considered 'chatty' by logcat (more than 5 lines per second), logs of your app will be collapsed.

You can avoid this behaviour by whitelisting your app for logcat:

adb logcat -P '<pid or uid of your app>'

You can print the current white and black lists by executing:

adb logcat -p

Also this command is helpful to print logcat statistics:

adb logcat -S

Additionally, I found useful to auto-whitelist my app for logcat directly from code during tests:

int pid = android.os.Process.myPid();
String whiteList = "logcat -P '" + pid + "'";
Runtime.getRuntime().exec(whiteList).waitFor();

More info can be found in official docs for logcat here

Kyle Falconer
  • 8,302
  • 6
  • 48
  • 68
Anton Malmygin
  • 3,406
  • 2
  • 25
  • 31
  • @lorenzo-s What is your outputs of `adb logcat -p` and `adb logcat -S` ? – Anton Malmygin Aug 18 '17 at 09:16
  • `adb logcat -p` prints my app PID, i.e. the one I used in `adb logcat -P 'pid'`, the same I see in Studio's Android Monitor logcat dropdown. And [here is](https://pastebin.com/raw/iAakRCNL) the output for `adb logcat -S` – lorenzo-s Aug 18 '17 at 09:19
  • I do not really see your app inside `Chattiest UIDs in main log buffer:` section. Are you sure what your app considered chatty ? – Anton Malmygin Aug 18 '17 at 09:34
  • Yes, I constantly get the `chatty` messages in logcat, saying lines have been skipped. You don't see it because probably it was a fresh start, and I only run that commands to send you the output. [Here is](https://pastebin.com/raw/fEM8DJzE) the same log after printing some chatty messages, my app is the one with PID 11432, the same I see with `adb logcat -p` – lorenzo-s Aug 18 '17 at 09:40
  • First, try to whitelist your app by UID, not PID. If this not help, I can only suggest to reboot your device, restart adb, clear you whitelist and add your app PID/UID again. – Anton Malmygin Aug 18 '17 at 09:44
  • I tried also with UID 10077. I'll try to restart, thank you. – lorenzo-s Aug 18 '17 at 09:45
  • 1
    This works fine for me when doing it from the command line with adb, but it does not appear to work when doing it programmatically from an app. It returns an exit code of 1 every time whether using uid, pid, or uid/pid and the list as reflected by adb logcat -p does not show the app. I would recommend just using a third party logging framework such as log4j. – Thomas Sunderland Jun 27 '18 at 17:24
  • Does it work on a non-debug device? Seems not – T D Nguyen Jun 13 '22 at 03:29
46

Yes, this indicates that some messages did not make it into the actual log, maybe because other application(s) send too many messages into it.

This seem to be a new thing in liblog in Marshmallow(?). Can't find a clear explanation of the new logging policy, or even if there is actually one, but the change is kind of mentioned here :

We declared an application as too chatty once it logs more than 5 lines a second. Please file a bug against the application's owner that is producing this developer-verbose-debug-level class logging spam. The logs are 256KB, that means the application is creating a DOS attack and shortening the logs timepan to 6 seconds(!) making it useless for all others.

16

You can disable this behavior by using:

adb logcat -P ""

or by setting

setprop ro.logd.filter disable

setprop persist.logd.filter disable 

You can check the code at

http://androidxref.com/7.1.2_r36/xref/system/core/logd/LogWhiteBlackList.cpp

Zoe
  • 27,060
  • 21
  • 118
  • 148
nkalra0123
  • 2,281
  • 16
  • 17
  • The properties don't seem to disable it completely but I thing it helps if you link to liblog directly. – Chef Pharaoh Mar 13 '19 at 21:58
  • This is the correct answer, voting it up so hopefully one day it isn't the last in the list. – satur9nine Oct 24 '19 at 05:34
  • I used `setprop persist.logd.filter disable` on Android 8.1, then rebooted, but I still see `chatty ... identical` lines. Does `identical` mean that messages are still dropped? – zoulou Dec 22 '19 at 10:32
  • @zoulou well if those logs are identical, you are basically not missing anything else than the timestamp of those identical logs – Risinek Apr 01 '20 at 15:03
10

You can disable this behavior by using:

adb logcat -P ""
Chewpers
  • 2,430
  • 5
  • 23
  • 30
Dan Schmitt
  • 126
  • 1
  • 4
  • How can we turn it back on? Is this documented anywhere? – nealmcb Aug 23 '16 at 03:47
  • @nealmcb I don't think you can disable it forever. These things are always temporary, right? – milosmns Aug 25 '16 at 08:32
  • 1
    @milosmns Then how long does it last? Until reboot? – nealmcb Aug 26 '16 at 17:39
  • @nealmcb Well on my 6P it just flushes the log and exits – milosmns Aug 26 '16 at 17:51
  • @nealmcb When you do `adb logcat` next time without the `-P` option, you get the shortened log again. Strange how that works, is Chatty swallowing lines at runtime? – milosmns Aug 26 '16 at 17:57
  • @SantoshSalunke Can you be more specific? What happens? Error messages? – nealmcb May 01 '18 at 13:50
  • 2
    I don't get any error message. After this executing this command adb logcat -P "" , it does not disable chatty. I tried mentioning my app's UID/PID, it gets whitelisted but still chatty is not disabled. My device is OnePlus5 – srs May 02 '18 at 17:10
  • @Santosh Salunke The same on API 28 Android emulator – isabsent Mar 22 '19 at 11:03
0

First execute adb logcat -S to check your application is under Chattiest UID/PID.

If it is there whitelist your application by executing below command

adb logcat -P "UID/PID"

To check all your whitelisted/blacklisted application execute below command

adb logcat -p
Magudesh
  • 419
  • 5
  • 13