Accessing Android logging system

Like other Operating system, android also have a log that record when some problem occur. Using command “logcat” someone can open internal log from the system. This command is very helpfull, especially for the developer (ROM, Kernel etc) to diagnose the problem.

There`s to application that can help user to access the log, aLogcat or Catlog

Using ADB is another way to open the log, the advantage is we can access the log when the device still in boot.

Access logcat from ADB

To do this, you`ll need installed ADB in your windows. And connect the device using USB Cable.
Here`s some basic command to access the log

[adb] logcat [<option>] … [<filter-spec>] …

$ adb logcat


V — Verbose (lowest priority)
D — Debug
I — Info (default priority)
W — Warning
E — Error
F — Fatal
S — Silent (highest priority, on which nothing is ever printed)


-c Clears (flushes) the entire log and exits.
-v Sets the output format for log messages
-f <filename> Writes log message output to <filename>. The default is stdout.

To create logcat output as a text file

basically you just need this command

adb logcat > filename.txt

But, you`ll be shock when open and found there`s so many log that your device have. So, you can add a filter to reduce the result.

adb logcat -v long > filename.txt

Using Logcat to find problems

case: when you try using ramdisk and the wifi wouldn`t work.
Using a basic command like above, the logcat will give you all log problem. So let`s cut the result just for error(E) or fatal(F)

adb logcat WifiStateMachine:E *:S -v long > filename.txt

note: In order to filter out anything other than what you are looking for (in this case, WifiStateMachine) you must put a *:S after your last command (i.e. WifiStateMachine:E ThemeChoose:V … … AndroidRuntime:E *:S)



Related Post