Only log startup info (PID etc) for root context

Fixes gh-153
pull/165/head
Dave Syer 11 years ago
parent 6cf3b91b2e
commit a8c69220c7

@ -292,7 +292,7 @@ public class SpringApplication {
postProcessApplicationContext(context); postProcessApplicationContext(context);
applyInitializers(context); applyInitializers(context);
if (this.logStartupInfo) { if (this.logStartupInfo) {
logStartupInfo(); logStartupInfo(context.getParent() == null);
} }
load(context, sources.toArray(new Object[sources.size()])); load(context, sources.toArray(new Object[sources.size()]));
@ -437,9 +437,14 @@ public class SpringApplication {
/** /**
* Called to log startup information, subclasses may override to add additional * Called to log startup information, subclasses may override to add additional
* logging. * logging.
*
* @param isRoot true if this application is the root of a context hierarchy
*/ */
protected void logStartupInfo() { protected void logStartupInfo(boolean isRoot) {
new StartupInfoLogger(this.mainApplicationClass).logStarting(getApplicationLog()); if (isRoot) {
new StartupInfoLogger(this.mainApplicationClass)
.logStarting(getApplicationLog());
}
} }
/** /**

Loading…
Cancel
Save