From acfec86b433ad0e8b6b603c69650dc4fa4dd19be Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 5 Jun 2020 16:31:09 +0800 Subject: [PATCH] update destruction log and give better messages --- .../nacos/client/config/impl/ConfigHttpClientManager.java | 4 ++-- .../client/naming/remote/http/NamingHttpClientManager.java | 4 ++-- .../com/alibaba/nacos/common/executor/ThreadPoolManager.java | 4 ++-- .../com/alibaba/nacos/common/http/HttpClientBeanHolder.java | 4 ++-- .../java/com/alibaba/nacos/common/notify/NotifyCenter.java | 4 ++-- .../nacos/config/server/service/notify/HttpClientManager.java | 4 ++-- .../java/com/alibaba/nacos/naming/misc/HttpClientManager.java | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigHttpClientManager.java b/client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigHttpClientManager.java index 86de1116312..93b4287fe59 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigHttpClientManager.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/impl/ConfigHttpClientManager.java @@ -71,14 +71,14 @@ public static ConfigHttpClientManager getInstance() { @Override public void shutdown() throws NacosException { - NAMING_LOGGER.warn("[ConfigHttpClientManager] Start destroying NacosRestTemplate"); + NAMING_LOGGER.info("[ConfigHttpClientManager] Start destroying NacosRestTemplate"); try { HttpClientBeanHolder.shutdownNacosSyncRest(HTTP_CLIENT_FACTORY.getClass().getName()); } catch (Exception ex) { NAMING_LOGGER.error("[ConfigHttpClientManager] An exception occurred when the HTTP client was closed : {}", ExceptionUtil.getStackTrace(ex)); } - NAMING_LOGGER.warn("[ConfigHttpClientManager] Destruction of the end"); + NAMING_LOGGER.info("[ConfigHttpClientManager] Completed destruction of NacosRestTemplate"); } /** diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientManager.java b/client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientManager.java index 64ea659d1f9..4b6865b0c94 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientManager.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/remote/http/NamingHttpClientManager.java @@ -68,14 +68,14 @@ public NacosRestTemplate getNacosRestTemplate() { @Override public void shutdown() throws NacosException { - NAMING_LOGGER.warn("[NamingHttpClientManager] Start destroying NacosRestTemplate"); + NAMING_LOGGER.info("[NamingHttpClientManager] Start destroying NacosRestTemplate"); try { HttpClientBeanHolder.shutdownNacosSyncRest(HTTP_CLIENT_FACTORY.getClass().getName()); } catch (Exception ex) { NAMING_LOGGER.error("[NamingHttpClientManager] An exception occurred when the HTTP client was closed : {}", ExceptionUtil.getStackTrace(ex)); } - NAMING_LOGGER.warn("[NamingHttpClientManager] Destruction of the end"); + NAMING_LOGGER.info("[NamingHttpClientManager] Completed destruction of NacosRestTemplate"); } private static class NamingHttpClientFactory extends AbstractHttpClientFactory { diff --git a/common/src/main/java/com/alibaba/nacos/common/executor/ThreadPoolManager.java b/common/src/main/java/com/alibaba/nacos/common/executor/ThreadPoolManager.java index b03a2b5222b..83e8876f02e 100644 --- a/common/src/main/java/com/alibaba/nacos/common/executor/ThreadPoolManager.java +++ b/common/src/main/java/com/alibaba/nacos/common/executor/ThreadPoolManager.java @@ -51,9 +51,9 @@ public final class ThreadPoolManager { static { INSTANCE.init(); ThreadUtils.addShutdownHook(new Thread(() -> { - LOGGER.warn("[ThreadPoolManager] Start destroying ThreadPool"); + LOGGER.info("[ThreadPoolManager] Start destroying ThreadPool"); shutdown(); - LOGGER.warn("[ThreadPoolManager] Destruction of the end"); + LOGGER.info("[ThreadPoolManager] Completed destruction of ThreadPool"); })); } diff --git a/common/src/main/java/com/alibaba/nacos/common/http/HttpClientBeanHolder.java b/common/src/main/java/com/alibaba/nacos/common/http/HttpClientBeanHolder.java index 117bd1c8399..4126bccc21d 100644 --- a/common/src/main/java/com/alibaba/nacos/common/http/HttpClientBeanHolder.java +++ b/common/src/main/java/com/alibaba/nacos/common/http/HttpClientBeanHolder.java @@ -99,7 +99,7 @@ private static void shutdown() { if (!ALREADY_SHUTDOWN.compareAndSet(false, true)) { return; } - LOGGER.warn("[HttpClientBeanHolder] Start destroying common HttpClient"); + LOGGER.info("[HttpClientBeanHolder] Start destroying common HttpClient"); try { shutdown(DefaultHttpClientFactory.class.getName()); @@ -108,7 +108,7 @@ private static void shutdown() { ExceptionUtil.getStackTrace(ex)); } - LOGGER.warn("[HttpClientBeanHolder] Destruction of the end"); + LOGGER.info("[HttpClientBeanHolder] Completed destruction of HttpClient"); } /** diff --git a/common/src/main/java/com/alibaba/nacos/common/notify/NotifyCenter.java b/common/src/main/java/com/alibaba/nacos/common/notify/NotifyCenter.java index 72a5d1fdd62..6a1e01f1891 100644 --- a/common/src/main/java/com/alibaba/nacos/common/notify/NotifyCenter.java +++ b/common/src/main/java/com/alibaba/nacos/common/notify/NotifyCenter.java @@ -131,7 +131,7 @@ public static void shutdown() { if (!CLOSED.compareAndSet(false, true)) { return; } - LOGGER.warn("[NotifyCenter] Start destroying Publisher"); + LOGGER.info("[NotifyCenter] Start destroying Publisher"); for (Map.Entry entry : INSTANCE.publisherMap.entrySet()) { try { @@ -148,7 +148,7 @@ public static void shutdown() { LOGGER.error("[SharePublisher] shutdown has error : ", e); } - LOGGER.warn("[NotifyCenter] Destruction of the end"); + LOGGER.info("[NotifyCenter] Completed destruction of Publisher"); } /** diff --git a/config/src/main/java/com/alibaba/nacos/config/server/service/notify/HttpClientManager.java b/config/src/main/java/com/alibaba/nacos/config/server/service/notify/HttpClientManager.java index c2af4219e29..b7ae1597332 100644 --- a/config/src/main/java/com/alibaba/nacos/config/server/service/notify/HttpClientManager.java +++ b/config/src/main/java/com/alibaba/nacos/config/server/service/notify/HttpClientManager.java @@ -64,7 +64,7 @@ public static NacosAsyncRestTemplate getNacosAsyncRestTemplate() { } private static void shutdown() { - LOGGER.warn("[ConfigServer-HttpClientManager] Start destroying NacosRestTemplate"); + LOGGER.info("[ConfigServer-HttpClientManager] Start destroying NacosRestTemplate"); try { final String httpClientFactoryBeanName = ConfigHttpClientFactory.class.getName(); HttpClientBeanHolder.shutdownNacosSyncRest(httpClientFactoryBeanName); @@ -73,7 +73,7 @@ private static void shutdown() { LOGGER.error("[ConfigServer-HttpClientManager] An exception occurred when the HTTP client was closed : {}", ExceptionUtil.getStackTrace(ex)); } - LOGGER.warn("[ConfigServer-HttpClientManager] Destruction of the end"); + LOGGER.info("[ConfigServer-HttpClientManager] Completed destruction of NacosRestTemplate"); } /** diff --git a/naming/src/main/java/com/alibaba/nacos/naming/misc/HttpClientManager.java b/naming/src/main/java/com/alibaba/nacos/naming/misc/HttpClientManager.java index 46452800fb1..a114febe018 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/misc/HttpClientManager.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/misc/HttpClientManager.java @@ -104,7 +104,7 @@ public static NacosAsyncRestTemplate getProcessorNacosAsyncRestTemplate() { } private static void shutdown() { - SRV_LOG.warn("[NamingServerHttpClientManager] Start destroying HTTP-Client"); + SRV_LOG.info("[NamingServerHttpClientManager] Start destroying HTTP-Client"); try { HttpClientBeanHolder.shutdownNacosSyncRest(SYNC_HTTP_CLIENT_FACTORY.getClass().getName()); HttpClientBeanHolder.shutdownNacosSyncRest(APACHE_SYNC_HTTP_CLIENT_FACTORY.getClass().getName()); @@ -114,7 +114,7 @@ private static void shutdown() { SRV_LOG.error("[NamingServerHttpClientManager] An exception occurred when the HTTP client was closed : {}", ExceptionUtil.getStackTrace(ex)); } - SRV_LOG.warn("[NamingServerHttpClientManager] Destruction of the end"); + SRV_LOG.info("[NamingServerHttpClientManager] Completed destruction of HTTP-Client"); } private static class AsyncHttpClientFactory extends AbstractHttpClientFactory {