我在web.xml设了:
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>abc.root</param-value>
</context-param>
然后在log4j.properties里设了:
log4j.appender.logfile.File=${abc.root}/abc.log我的tomcat是5.0.28,装在D:\最后自动生成的日志为D:\abc.log为什么${abc.root}不起作用呢?应该怎么配呀??????
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>abc.root</param-value>
</context-param>
然后在log4j.properties里设了:
log4j.appender.logfile.File=${abc.root}/abc.log我的tomcat是5.0.28,装在D:\最后自动生成的日志为D:\abc.log为什么${abc.root}不起作用呢?应该怎么配呀??????
在java文件里对这个文件先进行操作,设定文件路径,不过好象比较不合常理
http://www.javaresearch.org/article/showarticle.jsp?column=2&thread=12639
<!--
- Key of the system property that should specify the root directory of this
- web app. Applied by WebAppRootListener or Log4jConfigListener.
-->
加上WebAppRootListener 或Log4jConfigListener就得了