From 8b125c7c3ee4c956395f14375d9872ba5fe14457 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Mon, 13 Nov 2023 19:50:47 +0100 Subject: [PATCH] Revert "Add and improve logs in ACS bootstrap process (#6890)" This reverts commit 8fa8cefb5b70442f6057b69dd92f0cec9fe97508. --- .../model/impl/DefaultModuleDefinitionSet.java | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java index ec9bbc0cd972..5dab5d7bd349 100644 --- a/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java +++ b/framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java @@ -97,18 +97,16 @@ protected void startContexts() { @Override public void with(ModuleDefinition def, Stack parents) { try { - String moduleDefinitionName = def.getName(); - log.debug(String.format("Trying to obtain module [%s] context.", moduleDefinitionName)); - ApplicationContext context = getApplicationContext(moduleDefinitionName); + ApplicationContext context = getApplicationContext(def.getName()); try { Runnable runnable = context.getBean("moduleStartup", Runnable.class); - log.info(String.format("Starting module [%s].", moduleDefinitionName)); + log.info("Starting module [" + def.getName() + "]"); runnable.run(); } catch (BeansException e) { - log.error(String.format("Failed to start module [%s] due to: [%s].", moduleDefinitionName, e.getMessage()), e); + // Ignore } } catch (EmptyStackException e) { - log.error(String.format("Failed to obtain module context due to [%s]. Using root context instead.", e.getMessage()), e); + // The root context is already loaded, so ignore the exception } } }); @@ -119,15 +117,10 @@ protected void loadContexts() { @Override public void with(ModuleDefinition def, Stack parents) { try { - String moduleDefinitionName = def.getName(); - log.debug(String.format("Trying to obtain module [%s] context.", moduleDefinitionName)); ApplicationContext parent = getApplicationContext(parents.peek().getName()); - log.debug(String.format("Trying to load module [%s] context.", moduleDefinitionName)); loadContext(def, parent); } catch (EmptyStackException e) { - log.error(String.format("Failed to obtain module context due to [%s]. Using root context instead.", e.getMessage()), e); - } catch (BeansException e) { - log.error(String.format("Failed to load module [%s] due to: [%s].", def.getName(), e.getMessage()), e); + // The root context is already loaded, so ignore the exception } } });