Skip to content

Commit 41e9bc0

Browse files
author
Daniel Augusto Veronezi Salvador
committed
Merge branch 'add-logs-MS-startup' into '4.16.0.0-scclouds'
Adição de _logs_ no processo de inicialização do MS Closes apache#699 See merge request scclouds/scclouds!321
2 parents 269d6be + f261524 commit 41e9bc0

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,17 @@ protected void startContexts() {
9797
@Override
9898
public void with(ModuleDefinition def, Stack<ModuleDefinition> parents) {
9999
try {
100+
log.debug(String.format("Trying to obtain module [%s] context.", def.getName()));
100101
ApplicationContext context = getApplicationContext(def.getName());
101102
try {
102103
Runnable runnable = context.getBean("moduleStartup", Runnable.class);
103-
log.info("Starting module [" + def.getName() + "]");
104+
log.info(String.format("Starting module [%s].", def.getName()));
104105
runnable.run();
105106
} catch (BeansException e) {
106-
// Ignore
107+
log.error(String.format("Failed to start module [%s] due to: [%s].", def.getName(), e.getMessage()), e);
107108
}
108109
} catch (EmptyStackException e) {
109-
// The root context is already loaded, so ignore the exception
110+
log.error(String.format("Failed to obtain module context due to [%s]. Using root context instead.", e.getMessage()), e);
110111
}
111112
}
112113
});
@@ -117,10 +118,14 @@ protected void loadContexts() {
117118
@Override
118119
public void with(ModuleDefinition def, Stack<ModuleDefinition> parents) {
119120
try {
121+
log.debug(String.format("Trying to obtain module [%s] context.", def.getName()));
120122
ApplicationContext parent = getApplicationContext(parents.peek().getName());
123+
log.debug(String.format("Trying to load module [%s] context.", def.getName()));
121124
loadContext(def, parent);
122125
} catch (EmptyStackException e) {
123-
// The root context is already loaded, so ignore the exception
126+
log.error(String.format("Failed to obtain module context due to [%s]. Using root context instead.", e.getMessage()), e);
127+
} catch (BeansException e) {
128+
log.error(String.format("Failed to load module [%s] due to: [%s].", def.getName(), e.getMessage()), e);
124129
}
125130
}
126131
});

0 commit comments

Comments
 (0)