Просмотр исходного кода

refactor: improve logging information and descriptions

Co-authored-by: Zaiming (Stone) Shi <zmstone@gmail.com>
Thales Macedo Garitezi 2 лет назад
Родитель
Сommit
c9100c7591

+ 6 - 4
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
                         }

+ 1 - 1
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 <code>${.payload.content_type}</code> may be used."""
 
 republish_args_mqtt_properties.label: