From c9100c75915f2d209c941c1cc5f0657ec0507ff3 Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Wed, 6 Sep 2023 13:33:59 -0300 Subject: [PATCH] refactor: improve logging information and descriptions Co-authored-by: Zaiming (Stone) Shi --- apps/emqx_rule_engine/src/emqx_rule_actions.erl | 10 ++++++---- rel/i18n/emqx_rule_engine_schema.hocon | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/emqx_rule_engine/src/emqx_rule_actions.erl b/apps/emqx_rule_engine/src/emqx_rule_actions.erl index 93da7191a..89aceb96e 100644 --- a/apps/emqx_rule_engine/src/emqx_rule_actions.erl +++ b/apps/emqx_rule_engine/src/emqx_rule_actions.erl @@ -257,9 +257,10 @@ format_mqtt_properties(MQTTPropertiesTemplate, Selected, Env) -> ?SLOG( error, #{ - msg => "bad_mqtt_prop_value", + msg => "bad_mqtt_property_value_ignored", rule_id => RuleId, - reason => {Kind, Error}, + exception => Kind, + reason => Error, property => K, selected => Selected } @@ -297,9 +298,10 @@ coerce_properties_values(MQTTProperties, #{metadata := #{rule_id := RuleId}}) -> ?SLOG( error, #{ - msg => "bad_mqtt_prop_value", + msg => "bad_mqtt_property_value_ignored", rule_id => RuleId, - reason => {Kind, Error}, + reason => Error, + exception => Kind, property => K, value => V } diff --git a/rel/i18n/emqx_rule_engine_schema.hocon b/rel/i18n/emqx_rule_engine_schema.hocon index c661c553a..8a710a443 100644 --- a/rel/i18n/emqx_rule_engine_schema.hocon +++ b/rel/i18n/emqx_rule_engine_schema.hocon @@ -107,7 +107,7 @@ republish_args_user_properties.label: """User Properties""" republish_args_mqtt_properties.desc: -"""From which variable should the MQTT Publish Properties of the message be taken from. +"""From which variable should the MQTT Publish Properties of the message be taken. Placeholders like ${.payload.content_type} may be used.""" republish_args_mqtt_properties.label: