fix: add debug log for apps stop

This commit is contained in:
Zaiming Shi 2021-08-02 22:47:24 +02:00
parent e6907478ba
commit 58d0717b2f
2 changed files with 12 additions and 4 deletions

View File

@ -6,3 +6,8 @@ EMQX_ZONES__DEFAULT__LISTENERS__MQTT_WS__PROXY_PROTOCOL=true
EMQX_LOG__CONSOLE_HANDLER__ENABLE=true
EMQX_LOG__CONSOLE_HANDLER__LEVEL=debug
EMQX_LOG__PRIMARY_LEVEL=debug
EMQX_ZONES__DEFAULT__MQTT__MAX_TOPIC_ALIAS=10
EMQX_ZONES__DEFAULT__MQTT__RETRY_INTERVAL=2s
HOCON_ENV_OVERRIDE_PREFIX=EMQX_
EMQX_LOG__PRIMARY_LEVEL=debug
EMQX_LOG__CONSOLE_HANDLER__LEVEL=debug

View File

@ -211,11 +211,14 @@ shutdown() ->
shutdown(normal).
shutdown(Reason) ->
?LOG(critical, "emqx shutdown for ~s", [Reason]),
?SLOG(critical, #{msg => "stopping_apps", reason => Reason}),
_ = emqx_alarm_handler:unload(),
lists:foreach(fun application:stop/1
, lists:reverse(default_started_applications())
).
lists:foreach(fun stop_app/1, lists:reverse(default_started_applications())).
stop_app(App) ->
?SLOG(debug, #{msg => "stopping_app", app => App}),
application:stop(App).
reboot() ->
lists:foreach(fun application:start/1 , default_started_applications()).