我試圖從Jetty Maven插件版本9查看詳細的調試信息以診斷無關的錯誤。我看過一篇描述版本7的帖子Configure logging for Jetty's maven plugin?,另一篇帖子Use Log4j with jetty-maven-plugin 9.x描述了使用logback進行日誌記錄。我已經嘗試過提到的建議,包括在命令行中和pom.xml中的插件配置下設置各種系統屬性。我也嘗試在pom.xml的插件下添加各種依賴項。似乎沒有任何建議可行,而且我想知道是否我在做最新版本的錯誤或改變。無論我輸入什麼,標準輸出中都不會顯示詳細的日誌信息。 (見下文)。在這一點上,我甚至不需要與logback或log4j進行集成。我需要的只是任何類型的日誌 - 標準輸出或標準錯誤都可以。我知道我缺少一些非常基本的東西。以下是相關信息。爲Jetty Maven插件登錄標準輸出版本9
命令:
mvn jetty:run
的pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>me.question</groupId>
<artifactId>question1</artifactId>
<version>1.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.6.v20170531</version>
<configuration>
<webApp>
<!--
<defaultsDescriptor>src/main/webapp/resources/webdefault.xml</defaultsDescriptor>
-->
</webApp>
<httpConnector>
<port>8080</port>
</httpConnector>
<stopKey>jetty-stop</stopKey>
<stopPort>54326</stopPort>
<systemProperties>
</systemProperties>
</configuration>
<dependencies>
</dependencies>
</plugin>
</plugins>
</build>
標準出來:
[INFO] jetty-9.4.6.v20170531
[INFO] Scanning elapsed time=41ms
[INFO] DefaultSessionIdManager workerName=node0
[INFO] No SessionScavenger set, using defaults
[INFO] Scavenging every 660000ms
[INFO] Started [email protected]{/,file:///Users/me/projects/log/src/main/webapp/,AVAILABLE}{file:///Users/me/projects/log/src/main/webapp/}
[INFO] Started [email protected]{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
[INFO] Started @2055ms
[INFO] Started Jetty Server