Commit a8c69220 authored by Dave Syer's avatar Dave Syer

Only log startup info (PID etc) for root context

Fixes gh-153
parent 6cf3b91b
...@@ -292,7 +292,7 @@ public class SpringApplication { ...@@ -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 { ...@@ -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());
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment