Skip to content

Commit 9a43d2e

Browse files
committed
Revised log levels: less WARN and INFO, fine-tuned DEBUG vs TRACE
Issue: SPR-16946
1 parent a410d90 commit 9a43d2e

File tree

99 files changed

+461
-486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+461
-486
lines changed

spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,16 +259,16 @@ private void doValidateClass(Class<?> proxySuperClass, @Nullable ClassLoader pro
259259
if (!Modifier.isStatic(mod) && !Modifier.isPrivate(mod)) {
260260
if (Modifier.isFinal(mod)) {
261261
if (implementsInterface(method, ifcs)) {
262-
logger.warn("Unable to proxy interface-implementing method [" + method + "] because " +
262+
logger.info("Unable to proxy interface-implementing method [" + method + "] because " +
263263
"it is marked as final: Consider using interface-based JDK proxies instead!");
264264
}
265-
logger.info("Final method [" + method + "] cannot get proxied via CGLIB: " +
265+
logger.debug("Final method [" + method + "] cannot get proxied via CGLIB: " +
266266
"Calls to this method will NOT be routed to the target instance and " +
267267
"might lead to NPEs against uninitialized fields in the proxy instance.");
268268
}
269269
else if (!Modifier.isPublic(mod) && !Modifier.isProtected(mod) &&
270270
proxyClassLoader != null && proxySuperClass.getClassLoader() != proxyClassLoader) {
271-
logger.info("Method [" + method + "] is package-visible across different ClassLoaders " +
271+
logger.debug("Method [" + method + "] is package-visible across different ClassLoaders " +
272272
"and cannot get proxied via CGLIB: Declare this method as public or protected " +
273273
"if you need to support invocations through the proxy.");
274274
}

spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public Object getObject() throws BeansException {
255255
}
256256
else {
257257
if (this.targetName == null) {
258-
logger.warn("Using non-singleton proxies with singleton targets is often undesirable. " +
258+
logger.info("Using non-singleton proxies with singleton targets is often undesirable. " +
259259
"Enable prototype proxies by setting the 'targetName' property.");
260260
}
261261
return newPrototypeInstance();

spring-aop/src/main/java/org/springframework/aop/interceptor/AsyncExecutionAspectSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ protected void handleError(Throwable ex, Method method, Object... params) throws
314314
this.exceptionHandler.obtain().handleUncaughtException(ex, method, params);
315315
}
316316
catch (Throwable ex2) {
317-
logger.error("Exception handler for async method '" + method.toGenericString() +
317+
logger.warn("Exception handler for async method '" + method.toGenericString() +
318318
"' threw unexpected exception itself", ex2);
319319
}
320320
}

spring-aop/src/main/java/org/springframework/aop/interceptor/SimpleAsyncUncaughtExceptionHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* A default {@link AsyncUncaughtExceptionHandler} that simply logs the exception.
2626
*
2727
* @author Stephane Nicoll
28+
* @author Juergen Hoeller
2829
* @since 4.1
2930
*/
3031
public class SimpleAsyncUncaughtExceptionHandler implements AsyncUncaughtExceptionHandler {
@@ -35,7 +36,7 @@ public class SimpleAsyncUncaughtExceptionHandler implements AsyncUncaughtExcepti
3536
@Override
3637
public void handleUncaughtException(Throwable ex, Method method, Object... params) {
3738
if (logger.isErrorEnabled()) {
38-
logger.error("Unexpected error occurred invoking async method: " + method, ex);
39+
logger.error("Unexpected exception occurred invoking async method: " + method, ex);
3940
}
4041
}
4142

spring-aop/src/main/java/org/springframework/aop/target/AbstractPrototypeBasedTargetSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ else if (target instanceof DisposableBean) {
8585
((DisposableBean) target).destroy();
8686
}
8787
catch (Throwable ex) {
88-
logger.error("Couldn't invoke destroy method of bean with name '" + getTargetBeanName() + "'", ex);
88+
logger.warn("Destroy method on bean with name '" + getTargetBeanName() + "' threw an exception", ex);
8989
}
9090
}
9191
}

spring-beans/src/main/java/org/springframework/beans/BeanUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,8 @@ public static PropertyEditor findEditorByConvention(@Nullable Class<?> targetTyp
497497
try {
498498
Class<?> editorClass = cl.loadClass(editorName);
499499
if (!PropertyEditor.class.isAssignableFrom(editorClass)) {
500-
if (logger.isWarnEnabled()) {
501-
logger.warn("Editor class [" + editorName +
500+
if (logger.isInfoEnabled()) {
501+
logger.info("Editor class [" + editorName +
502502
"] does not implement [java.beans.PropertyEditor] interface");
503503
}
504504
unknownEditorTypes.add(targetType);

spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public AutowiredAnnotationBeanPostProcessor() {
150150
try {
151151
this.autowiredAnnotationTypes.add((Class<? extends Annotation>)
152152
ClassUtils.forName("javax.inject.Inject", AutowiredAnnotationBeanPostProcessor.class.getClassLoader()));
153-
logger.info("JSR-330 'javax.inject.Inject' annotation found and supported for autowiring");
153+
logger.trace("JSR-330 'javax.inject.Inject' annotation found and supported for autowiring");
154154
}
155155
catch (ClassNotFoundException ex) {
156156
// JSR-330 API not available - simply skip.

spring-beans/src/main/java/org/springframework/beans/factory/annotation/InitDestroyAnnotationBeanPostProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public void postProcessBeforeDestruction(Object bean, String beanName) throws Be
156156
metadata.invokeDestroyMethods(bean, beanName);
157157
}
158158
catch (InvocationTargetException ex) {
159-
String msg = "Invocation of destroy method failed on bean with name '" + beanName + "'";
159+
String msg = "Destroy method on bean with name '" + beanName + "' threw an exception";
160160
if (logger.isDebugEnabled()) {
161161
logger.warn(msg, ex.getTargetException());
162162
}
@@ -165,7 +165,7 @@ public void postProcessBeforeDestruction(Object bean, String beanName) throws Be
165165
}
166166
}
167167
catch (Throwable ex) {
168-
logger.error("Failed to invoke destroy method on bean with name '" + beanName + "'", ex);
168+
logger.warn("Failed to invoke destroy method on bean with name '" + beanName + "'", ex);
169169
}
170170
}
171171

spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -899,13 +899,13 @@ public void registerScope(String scopeName, Scope scope) {
899899
}
900900
Scope previous = this.scopes.put(scopeName, scope);
901901
if (previous != null && previous != scope) {
902-
if (logger.isInfoEnabled()) {
903-
logger.info("Replacing scope '" + scopeName + "' from [" + previous + "] to [" + scope + "]");
902+
if (logger.isDebugEnabled()) {
903+
logger.debug("Replacing scope '" + scopeName + "' from [" + previous + "] to [" + scope + "]");
904904
}
905905
}
906906
else {
907-
if (logger.isDebugEnabled()) {
908-
logger.debug("Registering scope '" + scopeName + "' with implementation [" + scope + "]");
907+
if (logger.isTraceEnabled()) {
908+
logger.trace("Registering scope '" + scopeName + "' with implementation [" + scope + "]");
909909
}
910910
}
911911
}
@@ -1526,8 +1526,8 @@ else if (mbd.isLazyInit()) {
15261526
}
15271527
}
15281528
else {
1529-
if (logger.isWarnEnabled()) {
1530-
logger.warn("Bean creation exception on non-lazy FactoryBean type check: " + ex);
1529+
if (logger.isInfoEnabled()) {
1530+
logger.info("Bean creation exception on non-lazy FactoryBean type check: " + ex);
15311531
}
15321532
}
15331533
onSuppressedException(ex);

spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -810,22 +810,22 @@ public void registerBeanDefinition(String beanName, BeanDefinition beanDefinitio
810810
}
811811
else if (existingDefinition.getRole() < beanDefinition.getRole()) {
812812
// e.g. was ROLE_APPLICATION, now overriding with ROLE_SUPPORT or ROLE_INFRASTRUCTURE
813-
if (logger.isWarnEnabled()) {
814-
logger.warn("Overriding user-defined bean definition for bean '" + beanName +
813+
if (logger.isInfoEnabled()) {
814+
logger.info("Overriding user-defined bean definition for bean '" + beanName +
815815
"' with a framework-generated bean definition: replacing [" +
816816
existingDefinition + "] with [" + beanDefinition + "]");
817817
}
818818
}
819819
else if (!beanDefinition.equals(existingDefinition)) {
820-
if (logger.isInfoEnabled()) {
821-
logger.info("Overriding bean definition for bean '" + beanName +
820+
if (logger.isDebugEnabled()) {
821+
logger.debug("Overriding bean definition for bean '" + beanName +
822822
"' with a different definition: replacing [" + existingDefinition +
823823
"] with [" + beanDefinition + "]");
824824
}
825825
}
826826
else {
827-
if (logger.isDebugEnabled()) {
828-
logger.debug("Overriding bean definition for bean '" + beanName +
827+
if (logger.isTraceEnabled()) {
828+
logger.trace("Overriding bean definition for bean '" + beanName +
829829
"' with an equivalent definition: replacing [" + existingDefinition +
830830
"] with [" + beanDefinition + "]");
831831
}

spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ protected void destroyBean(String beanName, @Nullable DisposableBean bean) {
571571
bean.destroy();
572572
}
573573
catch (Throwable ex) {
574-
logger.error("Destroy method on bean with name '" + beanName + "' threw an exception", ex);
574+
logger.warn("Destroy method on bean with name '" + beanName + "' threw an exception", ex);
575575
}
576576
}
577577

spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ private void invokeCustomDestroyMethod(final Method destroyMethod) {
338338
}
339339
}
340340
catch (InvocationTargetException ex) {
341-
String msg = "Invocation of destroy method '" + this.destroyMethodName +
342-
"' failed on bean with name '" + this.beanName + "'";
341+
String msg = "Destroy method '" + this.destroyMethodName + "' on bean with name '" +
342+
this.beanName + "' threw an exception";
343343
if (logger.isDebugEnabled()) {
344344
logger.warn(msg, ex.getTargetException());
345345
}
@@ -348,7 +348,7 @@ private void invokeCustomDestroyMethod(final Method destroyMethod) {
348348
}
349349
}
350350
catch (Throwable ex) {
351-
logger.error("Couldn't invoke destroy method '" + this.destroyMethodName +
351+
logger.warn("Failed to invoke destroy method '" + this.destroyMethodName +
352352
"' on bean with name '" + this.beanName + "'", ex);
353353
}
354354
}

spring-beans/src/main/java/org/springframework/beans/factory/support/FactoryBeanRegistrySupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected Class<?> getTypeForFactoryBean(final FactoryBean<?> factoryBean) {
6666
}
6767
catch (Throwable ex) {
6868
// Thrown from the FactoryBean's getObjectType implementation.
69-
logger.warn("FactoryBean threw exception from getObjectType, despite the contract saying " +
69+
logger.info("FactoryBean threw exception from getObjectType, despite the contract saying " +
7070
"that it should return null if the type of its object cannot be determined yet", ex);
7171
return null;
7272
}

spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultBeanDefinitionDocumentReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ protected void doRegisterBeanDefinitions(Element root) {
138138
// We cannot use Profiles.of(...) since profile expressions are not supported
139139
// in XML config. See SPR-12458 for details.
140140
if (!getReaderContext().getEnvironment().acceptsProfiles(specifiedProfiles)) {
141-
if (logger.isInfoEnabled()) {
142-
logger.info("Skipped XML bean definition file due to specified profiles [" + profileSpec +
141+
if (logger.isDebugEnabled()) {
142+
logger.debug("Skipped XML bean definition file due to specified profiles [" + profileSpec +
143143
"] not matching: " + getReaderContext().getResource());
144144
}
145145
return;

spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ public int loadBeanDefinitions(Resource resource) throws BeanDefinitionStoreExce
312312
*/
313313
public int loadBeanDefinitions(EncodedResource encodedResource) throws BeanDefinitionStoreException {
314314
Assert.notNull(encodedResource, "EncodedResource must not be null");
315-
if (logger.isInfoEnabled()) {
316-
logger.info("Loading XML bean definitions from " + encodedResource.getResource());
315+
if (logger.isDebugEnabled()) {
316+
logger.debug("Loading XML bean definitions from " + encodedResource.getResource());
317317
}
318318

319319
Set<EncodedResource> currentResources = this.resourcesCurrentlyBeingLoaded.get();

spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ public int compare(T o1, T o2) {
9595
}
9696
}
9797
catch (RuntimeException ex) {
98-
if (logger.isWarnEnabled()) {
99-
logger.warn("Could not sort objects [" + o1 + "] and [" + o2 + "]", ex);
98+
if (logger.isDebugEnabled()) {
99+
logger.debug("Could not sort objects [" + o1 + "] and [" + o2 + "]", ex);
100100
}
101101
return 0;
102102
}
@@ -119,7 +119,7 @@ private Object getPropertyValue(Object obj) {
119119
return this.beanWrapper.getPropertyValue(this.sortDefinition.getProperty());
120120
}
121121
catch (BeansException ex) {
122-
logger.info("PropertyComparator could not access property - treating as null for sorting", ex);
122+
logger.debug("PropertyComparator could not access property - treating as null for sorting", ex);
123123
return null;
124124
}
125125
}

spring-context-support/src/main/java/org/springframework/scheduling/commonj/TimerManagerFactoryBean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -145,7 +145,7 @@ public void destroy() {
145145
timer.cancel();
146146
}
147147
catch (Throwable ex) {
148-
logger.warn("Could not cancel CommonJ Timer", ex);
148+
logger.debug("Could not cancel CommonJ Timer", ex);
149149
}
150150
}
151151
this.timers.clear();

spring-context-support/src/main/java/org/springframework/scheduling/quartz/SchedulerFactoryBean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,8 @@ private void initSchedulerFactory(StdSchedulerFactory schedulerFactory) throws S
556556
}
557557

558558
if (this.configLocation != null) {
559-
if (logger.isInfoEnabled()) {
560-
logger.info("Loading Quartz config from [" + this.configLocation + "]");
559+
if (logger.isDebugEnabled()) {
560+
logger.debug("Loading Quartz config from [" + this.configLocation + "]");
561561
}
562562
PropertiesLoaderUtils.fillProperties(mergedProps, this.configLocation);
563563
}

spring-context-support/src/main/java/org/springframework/ui/freemarker/FreeMarkerConfigurationFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ public Configuration createConfiguration() throws IOException, TemplateException
259259

260260
// Load config file if specified.
261261
if (this.configLocation != null) {
262-
if (logger.isInfoEnabled()) {
263-
logger.info("Loading FreeMarker configuration from " + this.configLocation);
262+
if (logger.isDebugEnabled()) {
263+
logger.debug("Loading FreeMarker configuration from " + this.configLocation);
264264
}
265265
PropertiesLoaderUtils.fillProperties(props, this.configLocation);
266266
}
@@ -391,7 +391,7 @@ protected void postProcessTemplateLoaders(List<TemplateLoader> templateLoaders)
391391
protected TemplateLoader getAggregateTemplateLoader(List<TemplateLoader> templateLoaders) {
392392
switch (templateLoaders.size()) {
393393
case 0:
394-
logger.info("No FreeMarker TemplateLoaders specified");
394+
logger.debug("No FreeMarker TemplateLoaders specified");
395395
return null;
396396
case 1:
397397
return templateLoaders.get(0);

spring-context-support/src/main/java/org/springframework/ui/freemarker/SpringTemplateLoader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -58,8 +58,8 @@ public SpringTemplateLoader(ResourceLoader resourceLoader, String templateLoader
5858
templateLoaderPath += "/";
5959
}
6060
this.templateLoaderPath = templateLoaderPath;
61-
if (logger.isInfoEnabled()) {
62-
logger.info("SpringTemplateLoader for FreeMarker: using resource loader [" + this.resourceLoader +
61+
if (logger.isDebugEnabled()) {
62+
logger.debug("SpringTemplateLoader for FreeMarker: using resource loader [" + this.resourceLoader +
6363
"] and template loader path [" + this.templateLoaderPath + "]");
6464
}
6565
}

spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -77,9 +77,9 @@ public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, B
7777
}
7878
}
7979
}
80-
if (!candidateFound) {
80+
if (!candidateFound && logger.isInfoEnabled()) {
8181
String name = getClass().getSimpleName();
82-
logger.warn(String.format("%s was imported but no annotations were found " +
82+
logger.info(String.format("%s was imported but no annotations were found " +
8383
"having both 'mode' and 'proxyTargetClass' attributes of type " +
8484
"AdviceMode and boolean respectively. This means that auto proxy " +
8585
"creator registration and configuration may not have occurred as " +

spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ protected boolean isOverriddenByExistingDefinition(BeanMethod beanMethod, String
309309
throw new BeanDefinitionStoreException(beanMethod.getConfigurationClass().getResource().getDescription(),
310310
beanName, "@Bean definition illegally overridden by existing bean definition: " + existingBeanDef);
311311
}
312-
if (logger.isInfoEnabled()) {
313-
logger.info(String.format("Skipping bean definition for %s: a definition for bean '%s' " +
312+
if (logger.isDebugEnabled()) {
313+
logger.debug(String.format("Skipping bean definition for %s: a definition for bean '%s' " +
314314
"already exists. This top-level bean definition is considered as an override.",
315315
beanMethod, beanName));
316316
}

spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,9 @@ public Object intercept(Object enhancedConfigInstance, Method beanMethod, Object
348348
// The factory is calling the bean method in order to instantiate and register the bean
349349
// (i.e. via a getBean() call) -> invoke the super implementation of the method to actually
350350
// create the bean instance.
351-
if (logger.isWarnEnabled() &&
351+
if (logger.isInfoEnabled() &&
352352
BeanFactoryPostProcessor.class.isAssignableFrom(beanMethod.getReturnType())) {
353-
logger.warn(String.format("@Bean method %s.%s is non-static and returns an object " +
353+
logger.info(String.format("@Bean method %s.%s is non-static and returns an object " +
354354
"assignable to Spring's BeanFactoryPostProcessor interface. This will " +
355355
"result in a failure to process annotations such as @Autowired, " +
356356
"@Resource and @PostConstruct within the method's declaring " +
@@ -490,17 +490,17 @@ private Object enhanceFactoryBean(final Object factoryBean, Class<?> exposedType
490490
boolean finalMethod = Modifier.isFinal(clazz.getMethod("getObject").getModifiers());
491491
if (finalClass || finalMethod) {
492492
if (exposedType.isInterface()) {
493-
if (logger.isDebugEnabled()) {
494-
logger.debug("Creating interface proxy for FactoryBean '" + beanName + "' of type [" +
493+
if (logger.isTraceEnabled()) {
494+
logger.trace("Creating interface proxy for FactoryBean '" + beanName + "' of type [" +
495495
clazz.getName() + "] for use within another @Bean method because its " +
496496
(finalClass ? "implementation class" : "getObject() method") +
497497
" is final: Otherwise a getObject() call would not be routed to the factory.");
498498
}
499499
return createInterfaceProxyForFactoryBean(factoryBean, exposedType, beanFactory, beanName);
500500
}
501501
else {
502-
if (logger.isInfoEnabled()) {
503-
logger.info("Unable to proxy FactoryBean '" + beanName + "' of type [" +
502+
if (logger.isDebugEnabled()) {
503+
logger.debug("Unable to proxy FactoryBean '" + beanName + "' of type [" +
504504
clazz.getName() + "] for use within another @Bean method because its " +
505505
(finalClass ? "implementation class" : "getObject() method") +
506506
" is final: A getObject() call will NOT be routed to the factory. " +

spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ protected final SourceClass doProcessConfigurationClass(ConfigurationClass confi
272272
processPropertySource(propertySource);
273273
}
274274
else {
275-
logger.warn("Ignoring @PropertySource annotation on [" + sourceClass.getMetadata().getClassName() +
275+
logger.info("Ignoring @PropertySource annotation on [" + sourceClass.getMetadata().getClassName() +
276276
"]. Reason: Environment must implement ConfigurableEnvironment");
277277
}
278278
}

spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ public void enhanceConfigurationClasses(ConfigurableListableBeanFactory beanFact
376376
throw new BeanDefinitionStoreException("Cannot enhance @Configuration bean definition '" +
377377
beanName + "' since it is not stored in an AbstractBeanDefinition subclass");
378378
}
379-
else if (logger.isWarnEnabled() && beanFactory.containsSingleton(beanName)) {
380-
logger.warn("Cannot enhance @Configuration bean definition '" + beanName +
379+
else if (logger.isInfoEnabled() && beanFactory.containsSingleton(beanName)) {
380+
logger.info("Cannot enhance @Configuration bean definition '" + beanName +
381381
"' since its singleton instance has been created too early. The typical cause " +
382382
"is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor " +
383383
"return type: Consider declaring such methods as 'static'.");

0 commit comments

Comments
 (0)