作開發的應該注意到Log4jConfigServlet,供配置spring應用的日誌使用,其使用方法同ContextLoaderServlet.web
好比:在web中配置spring
<!-- Log4j -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:/log4j.properties</param-value>
</context-param>
ide
加上spa
<servlet>
<servlet-name>lo4jConfigServlet</servlet-name>
<servlet-class>org.springframework.web.util.Lo4jConfigServlet></servlet-class>
</servlet>
日誌
或者orm
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>開發