RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
Table of Contents | ||
---|---|---|
|
Info |
---|
This page is under development |
RDK logger is a general purpose logging mechanism which is used for logging in RDK-B. Internally this uses log4c for formatting and supporting multiple log levels for different modules. The log level for each component is read from a configuration file debug.ini (rdkb_debug.ini) during component initialisation. Logger is implemented as a shared library and components need to link this library in order to include logging functionality.
RDK logger is linked to RDK-B modules to enable component wise logging. When the unit boots-up, each RDK-B component will be initialised which in turn will initialise logger and start logging into the corresponding log file depending on the log level set for the component.
Note: The RDK data model naming convention prefix was changed in March 2020 to “X_RDK_”. We request you use this new prefix going forward.
draw.io Diagram | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Gliffy Diagram | ||||||||||
|
...
Steps to add rdklogger to a new component:
Step 1:
Need to add LoggerEnable and LogLevel parameters in “LogAgent.xml” file for new component.
Code Block |
---|
X_RDKCENTRAL-COM_New_LoggerEnable |
...
X_RDKCENTRAL-COM_New_LogLevel |
Step 2:
Need to add the new parameters in “system_defaults_arm” file for persistent storage.
Code Block |
---|
$ X_RDKCENTRAL-COM_New_LogLevel=4 |
...
$ X_RDKCENTRAL-COM_New_LoggerEnable=1 |
Code functionality for Loglevel & LoggerEnable parameters set/get in “cosa_apis_logagentplugin.c” file
Initialise rdklogger by calling rdk_logger_init (/fss/gw/lib/debug.ini) in the new component
Step 3:
Add new component entry in “rdkb_debug.ini” file
Code Block |
---|
LOG.RDK.New = ALL FATAL ERROR WARNING NOTICE INFO DEBUG TRACE |
Step 4:
Add the below configuration in “rdkb_log4src” file for new component
...
For Doxygen documentation on the RDK Logger please refer: Doxygen RDK Logger