2011-07-08 129 views
8

我正在寻找一种方法来设置Log4j(或任何其他记录器),以便我可以在日志中看到每当Spring创建一个bean或设置一个bean属性。例如。这样的事情:日志Spring bean创建/依赖注入

1:00:00 Creating bean Foo ([email protected]) 
1:00:01 Creating bean Bar ([email protected]) 
1:00:02 Setting bean Foo ([email protected]) to Bar ([email protected]) 
(...) 

这很容易吗?我使用Spring 2.5.6(没有选择那里:/)和Log4j(版本并不重要,我期望)。

回答

6

貌似org.springframework.beans.factory.support.DefaultListableBeanFactory记录器是你可以得到最好的。

此外,只需尝试打开全部整个org.springframework的日志记录级别 - 也许你会发现更有用的东西。

+0

org.springframework。* = WebSphere部署中的所有技巧 –