Improve context-related logging on web startup
Sample output at TRACE: ``` DispatcherServlet - Initializing Servlet 'org.springframework.web.servlet.DispatcherServlet-7a8c8dcf' AnnotationConfigWebApplicationContext - Refreshing WebApplicationContext for namespace 'org.springframework.web.servlet.DispatcherServlet-7a8c8dcf-servlet', started on Wed Jul 25 17:46:38 EDT 2018 AnnotationConfigWebApplicationContext - Registering [org.springframework.web.servlet.mvc.method.annotation.RequestPartIntegrationTests$CommonsMultipartResolverTestConfig] AnnotationConfigWebApplicationContext - No 'messageSource' bean, using [Empty MessageSource] AnnotationConfigWebApplicationContext - No 'applicationEventMulticaster' bean, using [SimpleApplicationEventMulticaster] AnnotationConfigWebApplicationContext - No 'lifecycleProcessor' bean, using [DefaultLifecycleProcessor] ... DispatcherServlet - Initialization completed in 3361 ms ``` Issue: SPR-16946
This commit is contained in:
@@ -303,7 +303,7 @@ public class ContextLoader {
|
||||
|
||||
if (logger.isInfoEnabled()) {
|
||||
long elapsedTime = System.currentTimeMillis() - startTime;
|
||||
logger.info("Root WebApplicationContext: initialization completed in " + elapsedTime + " ms");
|
||||
logger.info("Root WebApplicationContext initialized in " + elapsedTime + " ms");
|
||||
}
|
||||
|
||||
return this.context;
|
||||
|
||||
@@ -230,7 +230,7 @@ public class AnnotationConfigWebApplicationContext extends AbstractRefreshableWe
|
||||
try {
|
||||
Class<?> clazz = ClassUtils.forName(configLocation, getClassLoader());
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Successfully resolved class for [" + configLocation + "]");
|
||||
logger.trace("Registering [" + configLocation + "]");
|
||||
}
|
||||
reader.register(clazz);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user