log4j.xml实例
?
其中,${appRoot}是指应用的根目录tomcat/webapps/myProject/,它配置在web.xml文件中:
?<context-param><param-name>webAppRootKey</param-name><param-value>appRoot</param-value></context-param><context-param><param-name>log4jConfigLocation</param-name><param-value>/WEB-INF/log4j.xml</param-value></context-param><listener><listener-class>org.springframework.web.util.Log4jConfigListener</listener-class></listener>