Skip to content

SimpleAliasRegistry misses log out in case of bean override [SPR-16871] #21410

@spring-projects-issues

Description

@spring-projects-issues

Michael Decker opened SPR-16871 and commented

As we realized in Non unique bean producer method names are not invoked #13252, org.springframework.core.SimpleAliasRegistry.registerAlias(String, String) does not have any log output, if a bean is overridden, only an exception:

if (!allowAliasOverriding()) {
    throw new IllegalStateException("Cannot register alias '" + alias + "' for name '" +
            name + "': It is already registered for name '" + registeredName + "'.");
}

But these implementation does have a log output, if they override a bean:

org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader: INFO
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry: INFO
org.springframework.beans.factory.support.FactoryBeanRegistrySupport: INFO
org.springframework.beans.factory.support.AbstractBeanFactory: INFO
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory: INFO
org.springframework.beans.factory.support.DefaultListableBeanFactory: INFO

Perhaps it's even possible to have a common approach to log this. For example org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener: DEBUG is a great help to understand auto configuration conditional issues. Something similar for such an issue would be great.


Affects: 5.0.6

Reference URL: spring-projects/spring-boot#13252

Referenced from: commits 74fcdea, 8a56db6

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions