fix(emqx_conf_app): print init_load failure to standard_error

logger may not get the chance to spit out the logs before the vm
dies, no matter how long sleep is added before init:stop(1)
This commit is contained in:
Zaiming (Stone) Shi 2023-04-27 20:48:53 +02:00
parent d3a26b45be
commit 7a81b96be0
1 changed files with 2 additions and 6 deletions

View File

@ -32,12 +32,8 @@ start(_StartType, _StartArgs) ->
ok = init_conf() ok = init_conf()
catch catch
C:E:St -> C:E:St ->
?SLOG(critical, #{ %% logger is not quite ready.
msg => failed_to_init_config, io:format(standard_error, "Failed to load config~n~p~n~p~n~p~n", [C, E, St]),
exception => C,
reason => E,
stacktrace => St
}),
init:stop(1) init:stop(1)
end, end,
ok = emqx_config_logger:refresh_config(), ok = emqx_config_logger:refresh_config(),