android logcat logs chatty module line expire message
Asked Answered
G

5

87

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?

Gio answered 4/1, 2016 at 8:35 Comment(1)
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 linesSewn
L
88

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

Lawmaker answered 7/7, 2017 at 16:18 Comment(8)
@Odessaodetta What is your outputs of adb logcat -p and adb logcat -S ?Lawmaker
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 the output for adb logcat -SOdessaodetta
I do not really see your app inside Chattiest UIDs in main log buffer: section. Are you sure what your app considered chatty ?Lawmaker
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 the same log after printing some chatty messages, my app is the one with PID 11432, the same I see with adb logcat -pOdessaodetta
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.Lawmaker
I tried also with UID 10077. I'll try to restart, thank you.Odessaodetta
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.Poltroonery
Does it work on a non-debug device? Seems notSubak
E
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.

Elan answered 27/1, 2016 at 10:16 Comment(4)
I see this a lot for com.google.android.gms.persistent... should I file a bug against Google? :-DKacey
Also, I frequently see it say "expire 1 line" ... how is that too chatty?Kacey
I was gathering logs for 5-10 seconds and result was 261 log entries from chatty, so bug should be filled because chatty is too chatty :DCark
How can I disable this on the IDE ?Calif
F
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

Flatways answered 16/1, 2018 at 10:34 Comment(4)
The properties don't seem to disable it completely but I thing it helps if you link to liblog directly.Alamode
This is the correct answer, voting it up so hopefully one day it isn't the last in the list.Gobo
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?Mendel
@Mendel well if those logs are identical, you are basically not missing anything else than the timestamp of those identical logsLottielotto
F
10

You can disable this behavior by using:

adb logcat -P ""
Football answered 13/5, 2016 at 17:44 Comment(8)
How can we turn it back on? Is this documented anywhere?Kinship
@Kinship I don't think you can disable it forever. These things are always temporary, right?Piaffe
@Piaffe Then how long does it last? Until reboot?Kinship
@Kinship Well on my 6P it just flushes the log and exitsPiaffe
@Kinship 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?Piaffe
@SantoshSalunke Can you be more specific? What happens? Error messages?Kinship
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 OnePlus5Schoolbook
@Santosh Salunke The same on API 28 Android emulatorDutra
N
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
Niko answered 1/5, 2020 at 3:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.