Skip to content

IMqttEntityManager logging is too verbose in debug mode #723

@rumbu13

Description

@rumbu13

The problem

It is nearly impossible to debug a NetDaemon App due to verbosity of messages logged in console/log file. Every MQTT message generated by your app is logged, making extremely difficult to discern between your own debug messages and the ones generated by IMqttEntityManager.

Use case

I am updating 4 different sensors with rssi values gathered from various beacons. Since the beacons send their values usually every 3 seconds, there is a call to SetStateAsync/SetAttributeAsync every 3/4 seconds. That means that during 1 minute the screen/log is filled with 80-160 messages.

MQQT has a high throughoutput by design, it is expected to have a high number of messages but there is no need to have them as debug information.

A better option would be to log these messages with TRACE level instead of DEBUG level. Irrespective of the log level, logging every MQTT message can lead to a performance bottleneck. People really interested in ALL messages sent by their app can use a dedicated tool like MQTT Explorer or make their own calls to LogDebug when required.

Environment

  • NetDaemon release with the issue: 22.23.0
  • Operating environment (Home assistant Add-on/Docker/Dev setup): 2022.6.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions