The /data/misc/logd/ directory is filled with 256 MB log files. Currently I don't need debug log files, so I would like to turn off logging.

Partial solution:
It seems I can turn off with the following command from terminal:

stop logd

But I think this will work until you restart the device.


stop logd or setprop ctl.stop logd makes logcat completely unavailable (which may break some apps/daemons) and isn't persistent across reboots. For permanently removing logd you need to delete /system/etc/init/logd.rc file which defines this init service. But it's not recommended.

The /data/misc/logd/ directory is filled by logcatd which is a sub-service of main logd service. 256 MB is the default size but can be changed if required (1).

logd mainly covers the functionality of its desktop counterpart syslogd, but also includes klogd and partially auditd to get logs from SELinux subsystem of kernel. However logd just reads from (RAM) memory buffers and doesn't save to persistent memory (files) by default. Reason is evident, these saved logs are of no use to a majority of users (as you), but too many write requests for these logs reduce flash memory (eMMC) life unnecessarily.

If one needs these logs as files, a separate service named logcatd (logcat daemon which itself reads from logd) can save them to filesystem (on userdebug and eng builds only since Oreo (2)). Going through the resources (3, 4), it's easy to control this service permanently (persistent across reboots) by setting property persist.logd.logpersistd (to logcatd or clear) or by using shell scripts /system/bin/logpersist.[start|stop].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.