Print all the Spring beans that are loaded

前端 未结 8 1724
说谎
说谎 2020-11-28 03:05

Is there a way to print all the spring beans that are loaded on startup?I am using Spring 2.0.

8条回答
  •  死守一世寂寞
    2020-11-28 03:34

    You could try calling

    org.springframework.beans.factory.ListableBeanFactory.getBeansOfType(Object.class)
    

    Or turn on debug logging for org.springframework. (In spring boot, that's using a parameter --logging.level.org.springframework=DEBUG)

提交回复
热议问题