【发布时间】:2010-11-22 13:01:34
【问题描述】:
我有一个 webapp 打包为我在 Jetty(版本 6.1.25)中部署的战争。 Web 应用程序使用 log4j。我希望能够通过战争外部的配置文件(即未烧入)配置 webapp 日志记录。
我尝试使用自定义上下文 WebAppContext 和一个额外的类路径属性,该属性指向我想注入到 webapp 类路径的 log4j.properties 文件,但这不起作用。
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath">/quantel</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/quantel</Set>
<Set name="extraClasspath">quantel/log4j.properties</Set>
</Configure>
我收到以下错误消息:
log4j:WARN No appenders could be found for logger (org.apache.commons.configuration.ConfigurationUtils).
log4j:WARN Please initialize the log4j system properly.
Jetty 可以做到这一点吗?
提前致谢。
【问题讨论】:
标签: web-applications log4j classpath jetty