log4j动态确定日志文件

<!-- 动态确定log4j的日志目录,20110702,qibaoyuan,add; -->
	<context-param>
		<param-name>webAppRootKey</param-name>
		<param-value>webApp.root</param-value>
	</context-param>
	<!--
		开一条watchdog线程每60秒扫描一下配置文件的变化 (这样在web服务启动后再去修改配置文件也不用重新启动web服务了)
		20110702,qibaoyuan,add;
	-->
	<context-param>
		<param-name>log4jRefreshInterval</param-name>
		<param-value>60000</param-value>
	</context-param>
	<listener>
		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
	</listener>

#file:daily log
log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
log4j.appender.file.DatePattern='.'yyyy-MM-dd
log4j.appender.file.File=${webApp.root}/WEB-INF/logs/XD1156App.log
log4j.appender.file.Append=true
log4j.appender.file.Threshold=INFO
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n


你可能感兴趣的:(c,log4j,web服务)