I am trying to take logs (logcat and kmsg) via the following command
"logcat -v time -f /dev/kmsg | cat /proc/"
However I am not sure, where the log file is stored, and what will be its name. How do I identify it
You can also view logs via dmesg, which prints the kernel ring buffer and sends you to the end of the file. From there, you can use the command dmesg | less to scroll through the output. If you want to view log entries for the user facility, you need to issue the command dmesg –facility=user.
Logcat is a command-line tool that dumps a log of system messages when the device throws an error and sends messages that you have written from your app with the Log class. This page is about the command-line logcat tool, but you can also view log messages from the Logcat window in Android Studio.
Here is logcat option for getting kernel logs too
adb logcat -b all
OK, here are the results of a quick Google search:
What I got from those links are:
cat /proc/kmsg
logcat -v time -f /dev/kmsg
writes logcat outputs to kernel message bufferSo,
logcat -v time -f /dev/kmsg | cat /proc/kmsg
will output both logcat and kernel logs to stdout
(whatever it is). Probably, you may write the output to a file as follows:
logcat -v time -f /dev/kmsg | cat /proc/kmsg > /sdcard/log.txt
The above worked from adb shell
prompt on a rooted Android 4.4.2 device.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With