nRF Cloud Log backend doesn't filter unwanted messages generated as a side effect of sending other log messages

Hi!

We use nRF Cloud Log backend in our project. And during my research I found that it actually doesn't filter (despite the filtering code is there) messages generated by underlying libs when application log messages are sent to the cloud. This creates an endless stream of messages being sent to the cloud, even if the application is no longer logging messages.

It seems, I see a confirmation for this issue in the code. Here logger_init() is called, it sets up filtering by calling log_filter_set(..., 0) for every source that needs to be filtered out, and then log_backend_enable() is called which actually resets filtering by calling log_filter_set(..., level) for all sources registered in the logger.

My SDK version is 2.9.0. But I see that this code hasn't been changed since that version.

My configuration contains:
CONFIG_LOG_RUNTIME_FILTERING=y
CONFIG_NRF_CLOUD_LOG_BACKEND=y
# This option leads to sending endless messages like this "Sent lines:516, bytes:70952"
CONFIG_NRF_CLOUD_LOG_LOG_LEVEL_INF=y

 

This issue is currently not critical for our project.

Thank you!

Parents Reply
  • Hi Pascal,
    Thanks for your email. We (Ruslan) has found it ;)
    - The question is not critical for our current project but we would like to clarify it anyway.
    - It is not related to the cloud logging configuration/filtering/etc. It is related to the source code.
    - We use the SDK code (including the nrf_cloud_log_backend.c file) in our project, so we looked at that source code and have this question.
    - It is formulated in the original post in this thread. Pls have a look at it.
    - Just to repeat it briefly:
      -- There is some code to prevent an endless sending of log messages.
      -- It uses filtering of logs from some sources. The filtered_modules array defines these sources.
      -- But there seems an issue in the code - in the logs_backend_enable() function - logger_init() sets the mentioned filtering, but right after that log_backend_enable() resets it. So, the needed filtering does not work.
    - Can you please review that source code and either confirm there is the issue, or explain how it works if the code is correct.
    - We will try to reproduce the issue on practice, but will need to find time for that.
    Thank you!
    -Alexey

Children
No Data
Related