Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android system log file location

In Ubuntu, there is a /var/log/syslog file. What is the equavalent file of the ubuntus syslog in android? I have a rooted Android phone.

like image 546
jameshwart lopez Avatar asked Aug 27 '15 03:08

jameshwart lopez


People also ask

Where are Android system logs stored?

To access the logging output, run the 'adb' executable with following arguments to capture the Android Enterprise related logging: Windows: C:\Users\[username]\AppData\Local\Android\sdk\platform-tools> adb logcat -G 32M; adb shell setprop persist. log.

Where are most system logs stored?

Most log files are located in the /var/log/ directory. Some applications such as httpd and samba have a directory within /var/log/ for their log files. You may notice multiple files in the log file directory with numbers after them.


1 Answers

There are a few ways to view the System-Log - but finding the location of the log files is considerabaly harder. I will list 3 options that will allow you to view the logs (either on a device or computer), but I do not know where they are kept. I may be wrong, but from what I have gather, the Android System does not keep a "Log File". Rather, there is a buffer that contains the "Log" (again I may be wrong on this)!

You first option is to install an app from the play-store called aLogCat. This app is very useful for both viewing and sending logs from your device. It can be setup to Email you the "Log Files" from your device. This method works best with root.

The second method works by using the Android SDK. Connect your device (with USB-Debugging enabled) and, at a Terminal enter the following:

    $ adb logcat -d > logcat.txt

The -d option tells adb to copy the entire File Log from the Android System. Because you seem to know how UNIX Systems work, I won't explain the rest of the command.

A third option (if you are rooted, that is) is to install a Terminal Emulator on your Android device. Open the Terminal Emulator and enter the command:

    $ logcat -d > /sdcard/my-log-file.txt

This will do the same as above (except you don't need a computer, and the file saves on your device/SDcard. Feel free to change the "/sdcard/my-log-file.txt" part to anything you like, but I strongly recommend you save it to either your external or internal storage - so in short: Save it to a location you can accsess without # (superuser) permission!

like image 65
Ankush Avatar answered Oct 11 '22 13:10

Ankush