From 58d0717b2ff33afa96ec79e9debd7a9f1e475bb4 Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Mon, 2 Aug 2021 22:47:24 +0200 Subject: [PATCH] fix: add debug log for apps stop --- .ci/docker-compose-file/conf.cluster.env | 5 +++++ apps/emqx/src/emqx.erl | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.ci/docker-compose-file/conf.cluster.env b/.ci/docker-compose-file/conf.cluster.env index 2a10bd321..b5cefe472 100644 --- a/.ci/docker-compose-file/conf.cluster.env +++ b/.ci/docker-compose-file/conf.cluster.env @@ -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 diff --git a/apps/emqx/src/emqx.erl b/apps/emqx/src/emqx.erl index b1c976cc1..3002c0ee0 100644 --- a/apps/emqx/src/emqx.erl +++ b/apps/emqx/src/emqx.erl @@ -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()).