Thursday, 24 July 2014

What is Android Logging System and where the logs are saved in Android

Overview of Android Logging System:

What is Android Logging System?
  • Provide a mechanism for collecting and viewing system debug output.
  •  Logs from various applications and portions of the system are collected in a series of circular buffers, which then can be viewed and filtered by the logcat command.
Android Logging System
Introduction: 

The logging system consists of a kernel driver and kernel buffers for storing log messages:
  • HoneycombMR2Src/kernel/drivers/staging/android/logger.c
  • Create “/dev/log” folder in handle_device_event() of AndroidSrc/system/core/init/devices.c 
C/C++/Java APIs and classes: 
  • For making log messages
  • For accessing the log messages
logcat, the command for viewing log messages  AndroidSrc/system/core/logcat/
Ability to view and filter the log messages from the host machine (via Eclipse-ADT or DDMS)

Log device files
4 channels, each have a Ring/Circular Buffer:
  • /dev/log/radio – radio&phone-related messages (64KB)
  • /dev/log/events – system/hardware events (256KB)
  • /dev/log/system –framwork or low-level system messages (64KB)
  • /dev/log/main – everything else (64KB)
The maximum log message size of each channel is specified in kernel driver(logger.c)
File permission of each(radio/events/system/main) is 0662 (rw-rw-w)




1 comment: