chore(mgmt): PUT /configs?ignore_readonly=true, lower log to info level

This commit is contained in:
zmstone 2024-04-29 09:33:43 +02:00
parent c3d27347b0
commit 1db932df21
2 changed files with 2 additions and 2 deletions

View File

@ -415,7 +415,7 @@ check_keys_is_not_readonly(Conf, Opts) ->
[] -> [] ->
{ok, Conf}; {ok, Conf};
BadKeys when IgnoreReadonly -> BadKeys when IgnoreReadonly ->
?SLOG(warning, #{msg => "readonly_root_keys_ignored", keys => BadKeys}), ?SLOG(info, #{msg => "readonly_root_keys_ignored", keys => BadKeys}),
{ok, maps:without(BadKeys, Conf)}; {ok, maps:without(BadKeys, Conf)};
BadKeys -> BadKeys ->
BadKeysStr = lists:join(<<",">>, BadKeys), BadKeysStr = lists:join(<<",">>, BadKeys),

View File

@ -6,7 +6,7 @@ included readonly root keys (`cluster`, `rpc`, and `node`).
After this enhancement it can be called as `PUT /configs?ignore_readonly=true`, After this enhancement it can be called as `PUT /configs?ignore_readonly=true`,
EMQX will in this case ignore readonly root config keys, and apply the rest. EMQX will in this case ignore readonly root config keys, and apply the rest.
A warning message is logged to warn that the readonly keys are dropped. For observability purposes, an info level message is logged if any readonly keys are dropped.
Also fixed an exception when config has bad HOCON syntax (returns 500). Also fixed an exception when config has bad HOCON syntax (returns 500).
Now bad syntax will cause the API to return 400 (BAD_REQUEST). Now bad syntax will cause the API to return 400 (BAD_REQUEST).