本文只針對非Maven環境:web
1.拷入log4j相關的.jarspring
2.在web.xml中配置測試
<!--由Spring載入的Log4j配置文件位置--> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>classpath:log4j.properties</param-value> </context-param> <!--Spring log4j Config loader--> <listener> <listener-class> org.springframework.web.util.Log4jConfigListener </listener-class> </listener>
3.測試一下spa