Draft: Mqtt logging
current state of mqtt logging.
The idea / workflow:
- logging is done via
logging
module as always (e.g.logging.info("some message")
) - a special logging-handler [1] is attached to the root logger. The handler sends a mqtt message containing the log message and some meta information
- a new dispatcher handler [2] receives the mqtt log messages and re-publish them to a thing specific topic
- the thing specific topic is determined from the
thing_id
, which is send in the meta information. if nothing_id
is present, the message is not re-published. - the thing specific topic is accessible (read-only?) with the mqtt credentials created in the the frontend
[1] see https://codebase.helmholtz.cloud/ufz-tsm/tsm-dispatcher/-/blob/mqtt_logging/src/mqtt_logging.py
[2] see https://codebase.helmholtz.cloud/ufz-tsm/tsm-dispatcher/-/blob/mqtt_logging/src/LogMessageHandler.py
Edited by Bert Palm