Following Where are Android logcat files stored? I learn that logcat is saved as an internal ring buffer in the kernel, which is sized 256kb. Applications use a special API to ask the kernel to save logs.
My device logs are wayyyyyy larger. I know this because when I adb logcat > adblogcat.txt
I get a really large file. This implies that "something" clears the kernel buffers and stores them in the file system (?) and adb logcat
reads from this larger file.
Can anyone explain how this works? I am looking into https://github.com/cgjones/android-system-core/blob/master/logcat/logcat.cpp and I cannot understand the exact details.
Bonus points to someone who explains what happens on reboot, is the log saved between reboots?