两个项目的web.xml中都有一个日志监听器配置
<listener>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener>
这只需要在web.xml中配置
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>webName.root</param-value>
</context-param>
比如说我的项目名称是Recommend,则配置为
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>Recommend.root</param-value>
</context-param>