Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

spring 应用中添加log4j 配置 (See related posts)

// description of your code here

<!-- 定义一个key name, 这个key name 在运行时指向当前web app的根目录 --->
  <context-param>
		<param-name>webAppRootKey</param-name>
		<param-value>petstore.root</param-value>
  </context-param>
  <!-- 定义一个log4j 配置文件的路径名称 -->
  <context-param>
		<param-name>log4jConfigLocation</param-name>
		<param-value>/WEB-INF/log4j.properties</param-value>
  </context-param>
  <!-- 使用listener 配置 log4j  -->
  <listener>
		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
  </listener>

You need to create an account or log in to post comments to this site.


Click here to browse all 5137 code snippets

Related Posts