无法打印 spring 的日志信息

spring 的日志信息

在看 spring 源码,希望调试时,可以打印出附录中的日志信息。

于是,import 了 org.springframework.context 项目,并将其设为 required projects。结果,无法日志打出来。。。

将其从 required projects 里删除,使用 Add External Class Folder,设为类路径,即可打印。

真奇怪。


[color=red]查到原因了。因为各个 projects 下,src\test\resources 有 log4j.xml,要修改。[/color]


附录:

Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1d5550d:1265 startup date [Wed May 19 19:20:53 CST 2010]; root of context hierarchy (org.springframework.context.support.ClassPathXmlApplicationContext.java:454)
Loading XML bean definitions from class path resource [ch02/sample2/applicationContext.xml] (org.springframework.beans.factory.xml.XmlBeanDefinitionReader.java:315)
Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl] (org.springframework.beans.factory.xml.DefaultDocumentLoader.java:72)
Found beans DTD [http://www.springframework.org/dtd/spring-beans.dtd] in classpath: spring-beans.dtd (org.springframework.beans.factory.xml.BeansDtdResolver.java:73)
Loading bean definitions (org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.java:87)
Loaded 2 bean definitions from location pattern [ch02/sample2/applicationContext.xml] (org.springframework.beans.factory.xml.XmlBeanDefinitionReader.java:185)
Bean factory for org.springframework.context.support.ClassPathXmlApplicationContext@1d5550d: org.springframework.beans.factory.support.DefaultListableBeanFactory@116ab4e: defining beans [weatherService,weatherDao]; root of factory hierarchy (org.springframework.context.support.ClassPathXmlApplicationContext.java:468)
Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@1edc073] (org.springframework.context.support.ClassPathXmlApplicationContext.java:753)
Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@1922221] (org.springframework.context.support.ClassPathXmlApplicationContext.java:777)
Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@116ab4e: defining beans [weatherService,weatherDao]; root of factory hierarchy (org.springframework.beans.factory.support.DefaultListableBeanFactory.java:538)
Creating shared instance of singleton bean 'weatherService' (org.springframework.beans.factory.support.DefaultListableBeanFactory.java:214)
Creating instance of bean 'weatherService' (org.springframework.beans.factory.support.DefaultListableBeanFactory.java:430)
Eagerly caching bean 'weatherService' to allow for resolving potential circular references (org.springframework.beans.factory.support.DefaultListableBeanFactory.java:504)
Creating shared instance of singleton bean 'weatherDao' (org.springframework.beans.factory.support.DefaultListableBeanFactory.java:214)
Creating instance of bean 'weatherDao' (org.springframework.beans.factory.support.DefaultListableBeanFactory.java:430)
Eagerly caching bean 'weatherDao' to allow for resolving potential circular references (org.springframework.beans.factory.support.DefaultListableBeanFactory.java:504)
Finished creating instance of bean 'weatherDao' (org.springframework.beans.factory.support.DefaultListableBeanFactory.java:458)
Finished creating instance of bean 'weatherService' (org.springframework.beans.factory.support.DefaultListableBeanFactory.java:458)
Returning cached instance of singleton bean 'weatherDao' (org.springframework.beans.factory.support.DefaultListableBeanFactory.java:242)
Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor@1479feb] (org.springframework.context.support.ClassPathXmlApplicationContext.java:804)
Returning cached instance of singleton bean 'lifecycleProcessor' (org.springframework.beans.factory.support.DefaultListableBeanFactory.java:242)
Returning cached instance of singleton bean 'weatherService' (org.springframework.beans.factory.support.DefaultListableBeanFactory.java:242)
High was: 15.0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值