Please note that User Registration has been temporarily disabled due to a recent increase in automated registrations. If anyone needs an account, please request one here: RequestAccount. Thanks for your patience!--Wmat (talk)
Please email User:Wmat if you experience any issues with the Request Account form.

Android logger

From eLinux.org
Revision as of 23:45, 11 November 2009 by Tim Bird (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Here is some information on the Android logger:

Overview

General system-wide logging is supported by a kernel device driver call 'logger'. The code for the driver is in 'drivers/android/logger.c'.

The code supports 3 logging buffers, named "main", "events", and "radio", for different types of events.

Device Nodes

The driver is activated when a user-space program opens a device node with the appropriate major and minor number.

These nodes are located in /dev/log, as shown below:

# ls -l /dev/log
crw-rw--w-    1 0        1007      10,  50 Nov  5 02:00 events
crw-rw--w-    1 0        1007      10,  51 Nov  5 02:00 main
crw-rw--w-    1 0        1007      10,  49 Nov  5 02:00 radio

Logcat command

You can use the 'logcat' command to read the log. This command is located in /system/bin in the local filesystem, or you can access the functionality using the 'adb logcat' command.

Documentation on the use of this command is at: http://developer.android.com/guide/developing/tools/adb.html

Some quick notes:

  • Log messages each have a tag and log level.
    • You can filter the messages by tag and log level, with a different level per tag.
  • You can specify (using a system property) that various programs emit their stdout or stderr to the log.