Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel2

Overview

RDK loggers logger is a general purpose logging mechanism which is used for logging in RDK-B. Internally this uses log4c for formatting and support supporting multiple log levels and for different modules. The log level for each component is read from a configuration file debug.ini (rdkb_debug.ini) during component initializationinitialisation. Logger is implemented as a shared library and components need to link this library in order to  enable include logging functionality.

RDK logger is linked to RDKB RDK-B modules to enable component wise logging. When the unit boots-up, each RDKB RDK-B component will be initialized initialised which in turn will initialize initialise logger and start logging into the corresponding log file depending on the log level set for the component.

...

RDK-B Logger Architecture

  1. All module logs from modules (CcspTraceError, CcspTraceInfo, etc..) are routed to RDK logger modulelibrary. RDK logger logs these into logfiles log files based on module wise LogLevels & LoggerEnable options. RDK  logger uses log4c library internally to achieve the functionality.
  2. CCSPLogAgent:

All components have the separate TR181 parameters to control the  LogLevels  and  LoggerEnable  options.                                                                                                  

All component components logger parameters TR181 parameters exist in LogAgent.xml file which is handled by CcspLogAgent component. Those parameters are stored in syscfg.db file for persistent storage.

...

Note: We can enable/disable logging for the all components based on “X_RDKCENTRAL-COM_LoggerEnable” parameter. It is by default set as to “TRUE”.

  • LogLevels: We can set different log levels for each component. By default all modules log level is 4 (RDK_LOG_INFO).

...

ATOM processor components log messages are passed as a parameter to CcspLogAgent component via D-bus. Then CcspLogAgent routs the logs to rdklogger.
Example: In some of the devices WifiAgent component runs on the ATOM processor

How to add

...

rdklogger to

...

a new component

Steps to add the rdklogger to a new component:

Need to add LoggerEnable and LogLevel parameters in “LogAgent.xml” file for new component.

...

$ X_RDKCENTRAL-COM_New_LoggerEnable=1

Write Code functionality for Loglevel & LoggerEnable parameters set/get in “cosa_apis_logagentplugin.c” file

Initialize Initialise rdklogger by calling  rdk_logger_init (/fss/gw/lib/debug.ini)  in the NEW component

...

RDK Logger is available in the below path,

../source_code/components/generic/rdk_logger

Below bitbake commands are used for building rdk-logger,

Panel

$ bitbake -c compile -f rdk-logger

$ bitbake rdk-logger

$ bitbake rdk-generic-broadband-image

...