How do I get Spring to print out the bean definiti

2020-07-03 04:37发布

问题:

I have a spring app that is configured for Component Scanning, is there a flag or option that I can turn on that would cause spring to print out the fully qualified names of the classes that the spring framework scanner picks up?

回答1:

You can print this by configuring logging category (assuming you are using log4j), set org.springframework.context.annotation at debug level.

Check org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(String).

You can see the class is logging name of the classes at debug level. Verified in Spring 3.0.5 version.