Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Android logcat work?

How does logcat works? Does it output the logs only when connected to a reader else it redirects everything to /dev/null? I'll follow up with a different question based on this. Thank you

like image 941
dlsniper Avatar asked Jun 07 '26 07:06

dlsniper


1 Answers

In older versions of Android, there's a set of circular buffers in the kernel. Each log (main, slog, events, radio) has its own buffer. The original size was 64K, but that was increased in subsequent releases.

Recent versions of Android have moved toward user-space handling of logging.

Log collection is happening continuously, with older logs overwritten by newer logs.

The logcat command reads from one or more circular buffers, e.g. the default command reads from the main and system logs and interleaves them by timestamp. It isn't running unless you run it.

like image 171
fadden Avatar answered Jun 10 '26 08:06

fadden



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!