使用spring 设置log的相对路径
项目中必须是在使用spring
web.xml加入
< context-param > < param-name > webAppRootKey </ param-name > < param-value > webApp.root </ param-value > </ context-param > < context-param > < param-name > log4jConfigLocation </ param-name > < param-value > /WEB-INF/classes/log/log4j.properties </ param-value > </ context-param > < context-param > < param-name > log4jRefreshInterval </ param-name > < param-value > 600000 </ param-value > </ context-param > < listener > < listener-class > org.springframework.web.util.Log4jConfigListener </ listener-class > </ listener >