I have been dumped into doing some debugging of a springboot application running in tomcat and have a suspicion that the component scan is not choosing the correct implementation of at least one component.
How can I get tomcat to log the springboot component scan process without changing any code?
I have tried adding the following to the conf/logging.properties, but it does nothing:
logging.level.org.springframework.core.io.support=DEBUG
logging.level.org.springframework.context.annotation=DEBUG
I am not an enterprise java developer, hell, I am not really even a java developer...
Spring component scanning is complex and happens at different levels. If unsure of what type of information or verbosity required, one good option is to enable trace at a higher-level package. The output will include the package corresponding to each log line, which will help narrow down the results to what's intended. Example:
With the above set, it's possible to see some interesting logs, probably more than necessary. Depending on the level of verbosity and the type of information required, one can now narrow down the logs by specifying a deeper-level package at a specific log level:
Spring bean factory support:
Which shows logs like:
Spring bean auto-configuration:
Which shows logs like: