【发布时间】:2013-06-03 06:23:56
【问题描述】:
我将 Maven 3.0.4 与 tomcat7-maven-plugin 一起用于嵌入式 Tomcat 服务器。我想通过编辑 pom.xml 来生成服务器日志。但是,我无法在配置部分使用“tomcatLoggingFile”属性获取任何日志。以下是我的配置:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<tomcatLoggingFile>tomcat_server.log</tomcatLoggingFile>
</configuration>
</plugin>
我查看了 tomcat7-maven-plugin 的官方文档:http://tomcat.apache.org/maven-plugin-2.1/tomcat7-maven-plugin/run-mojo.html 但仍然不知道为什么它不起作用。
另外,我查看了这篇文章:Configuring Logging for an Embedded Tomcat from Maven plugin 并改用 org.slf4j.LoggerFactory 。在文件 tomcat_server.log 中没有找到任何日志。
当我在 pom.xml 中切换回使用 jboss-as-maven-plugin 并运行mvn jboss-as:run 时,可以在目标文件夹中成功生成 server.log。
有什么建议吗?
【问题讨论】:
标签: tomcat logging configuration