Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-16871

SimpleAliasRegistry misses log out in case of bean override

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 5.0.6
    • Fix Version/s: 5.0.7, 5.1 RC1
    • Component/s: Core:DI
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              kenori Michael Decker
              Last updater:
              St├ęphane Nicoll
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                4 weeks ago