我正在尝试按照命令启动jetty
/usr/bin/java -Djetty.home=/opt/jetty -Djetty.base=/opt/awesome/server -jar /opt/jetty/start.jar jetty.state=/opt/awesome/server/jetty.state /opt/jetty/etc/jetty-logging.xml
此命令在控制台输出
StartLog to /opt/jetty/logs/start.log
我的问题是为什么以上日志来到控制台,但我有一个jetty-logging.xml,如下所示
`
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<!-- =============================================================== -->
<!-- Configure stderr and stdout to a Jetty rollover log file -->
<!-- this configuration file should be used in combination with -->
<!-- other configuration files. e.g. -->
<!-- java -jar start.jar etc/jetty-logging.xml -->
<!-- =============================================================== -->
<Configure id="logging" class="org.eclipse.jetty.util.log.Log">
<New id="ServerLog" class="java.io.PrintStream">
<Arg>
<New class="org.eclipse.jetty.util.RolloverFileOutputStream">
<Arg><Property name="jetty.logs" default="./logs"/>/yyyy_mm_dd.stderrout.log</Arg>
<Arg type="boolean">false</Arg>
<Arg type="int">90</Arg>
<Arg><Call class="java.util.TimeZone" name="getTimeZone"><Arg>GMT</Arg></Call></Arg>
<Get id="ServerLogName" name="datedFilename"/>
</New>
</Arg>
</New>
<Get name="rootLogger">
<Call name="info"><Arg>Redirecting stderr/stdout to <Ref refid="ServerLogName"/></Arg></Call>
</Get>
<Call class="java.lang.System" name="setErr"><Arg><Ref refid="ServerLog"/></Arg></Call>
<Call class="java.lang.System" name="setOut"><Arg><Ref refid="ServerLog"/></Arg></Call>
</Configure>
`
此外,当我确实杀死-3 {JAVA PID}时,线程转储日志仅被重定向到控制台。
我想在一些日志文件中捕获此日志,而不使用像> or >>
这是输出
cd /opt/awesome/server/ && java -jar /opt/jetty/start.jar --list-config
`
Java Environment:
-----------------
java.home = /opt/jdk1.7.0_45/jre
java.vm.vendor = Oracle Corporation
java.vm.version = 24.45-b08
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
java.vm.info = mixed mode
java.runtime.name = Java(TM) SE Runtime Environment
java.runtime.version = 1.7.0_45-b18
java.io.tmpdir = /tmp
user.dir = /opt/awesome/server
user.language = en
user.country = US
Jetty Environment:
-----------------
jetty.version = 9.2.19.v20160908
jetty.home = /opt/jetty
jetty.base = /opt/awesome/server
Config Search Order:
--------------------
<command-line>
${jetty.base} -> /opt/awesome/server
${jetty.home} -> /opt/jetty
JVM Arguments:
--------------
(no jvm args specified)
System Properties:
------------------
(no system properties specified)
Properties:
-----------
demo.realm = etc/realm.properties
http.timeout = 30000
https.port = 8443
https.timeout = 30000
jaas.login.conf = etc/login.conf
jetty.delayDispatchUntilContent = false
jetty.dump.start = false
jetty.dump.stop = false
jetty.keymanager.password = OBF:1u2u1wml1z7s1z7a1wnl1u2g
jetty.keystore = etc/keystore
jetty.keystore.password = OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4
jetty.output.buffer.size = 32768
jetty.port = 8080
jetty.request.header.size = 8192
jetty.response.header.size = 8192
jetty.secure.port = 8443
jetty.send.date.header = false
jetty.send.server.version = true
jetty.truststore = etc/keystore
jetty.truststore.password = OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4
jsp-impl = apache
org.eclipse.jetty.websocket.jsr356 = false
threads.max = 200
threads.min = 10
threads.timeout = 60000
Jetty Server Classpath:
-----------------------
Version Information on 44 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
changes to the --module=name command line options will be reflected here.
0: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-client-9.2.19.v20160908.jar
1: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-continuation-9.2.19.v20160908.jar
2: 1.4.1.v201005082020 | ${jetty.base}/lib/ext/javax.mail.glassfish-1.4.1.v201005082020.jar
3: 9.2.19.v20160908 | ${jetty.base}/lib/ext/test-mock-resources-9.2.19.v20160908.jar
4: 1.0.7 | ${jetty.home}/lib/ext/logback-classic-1.0.7.jar
5: 1.0.7 | ${jetty.home}/lib/ext/logback-core-1.0.7.jar
6: 1.6.6 | ${jetty.home}/lib/ext/slf4j-api-1.6.6.jar
7: 9.2.19.v20160908 | ${jetty.home}/lib/apache-jsp/org.eclipse.jetty.apache-jsp-9.2.19.v20160908.jar
8: 3.8.2.v20130121-145325 | ${jetty.home}/lib/apache-jsp/org.eclipse.jetty.orbit.org.eclipse.jdt.core-3.8.2.v20130121.jar
9: 8.0.33 | ${jetty.home}/lib/apache-jsp/org.mortbay.jasper.apache-el-8.0.33.jar
10: 2.3 | ${jetty.home}/lib/apache-jsp/org.mortbay.jasper.apache-jsp-8.0.33.jar
11: 1.2.1 | ${jetty.home}/lib/apache-jstl/org.apache.taglibs.taglibs-standard-impl-1.2.1.jar
12: 1.2.1 | ${jetty.home}/lib/apache-jstl/org.apache.taglibs.taglibs-standard-spec-1.2.1.jar
13: (dir) | ${jetty.base}/resources
14: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
15: 3.1.0.M0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
16: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-http-9.2.19.v20160908.jar
17: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-server-9.2.19.v20160908.jar
18: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-xml-9.2.19.v20160908.jar
19: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-util-9.2.19.v20160908.jar
20: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-io-9.2.19.v20160908.jar
21: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-jaas-9.2.19.v20160908.jar
22: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-jndi-9.2.19.v20160908.jar
23: 1.4.1.v201005082020 | ${jetty.home}/lib/jndi/javax.mail.glassfish-1.4.1.v201005082020.jar
24: 1.2 | ${jetty.home}/lib/jndi/javax.transaction-api-1.2.jar
25: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-rewrite-9.2.19.v20160908.jar
26: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-security-9.2.19.v20160908.jar
27: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-servlet-9.2.19.v20160908.jar
28: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-servlets-9.2.19.v20160908.jar
29: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-webapp-9.2.19.v20160908.jar
30: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-deploy-9.2.19.v20160908.jar
31: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-plus-9.2.19.v20160908.jar
32: 9.2.19.v20160908 | ${jetty.home}/lib/jetty-annotations-9.2.19.v20160908.jar
33: 5.0.1 | ${jetty.home}/lib/annotations/asm-5.0.1.jar
34: 5.0.1 | ${jetty.home}/lib/annotations/asm-commons-5.0.1.jar
35: 1.2 | ${jetty.home}/lib/annotations/javax.annotation-api-1.2.jar
36: 1.0 | ${jetty.home}/lib/websocket/javax.websocket-api-1.0.jar
37: 9.2.19.v20160908 | ${jetty.home}/lib/websocket/javax-websocket-client-impl-9.2.19.v20160908.jar
38: 9.2.19.v20160908 | ${jetty.home}/lib/websocket/javax-websocket-server-impl-9.2.19.v20160908.jar
39: 9.2.19.v20160908 | ${jetty.home}/lib/websocket/websocket-api-9.2.19.v20160908.jar
40: 9.2.19.v20160908 | ${jetty.home}/lib/websocket/websocket-client-9.2.19.v20160908.jar
41: 9.2.19.v20160908 | ${jetty.home}/lib/websocket/websocket-common-9.2.19.v20160908.jar
42: 9.2.19.v20160908 | ${jetty.home}/lib/websocket/websocket-server-9.2.19.v20160908.jar
43: 9.2.19.v20160908 | ${jetty.home}/lib/websocket/websocket-servlet-9.2.19.v20160908.jar
Jetty Active XMLs:
------------------
${jetty.base}/etc/jetty-logging.xml
${jetty.home}/etc/jetty.xml
${jetty.home}/etc/jetty-http.xml
${jetty.home}/etc/jetty-jaas.xml
${jetty.home}/etc/jetty-rewrite.xml
${jetty.home}/etc/jetty-ssl.xml
${jetty.home}/etc/jetty-https.xml
${jetty.home}/etc/jetty-deploy.xml
${jetty.home}/etc/jetty-plus.xml
${jetty.home}/etc/jetty-annotations.xml
${jetty.base}/etc/demo-rewrite-rules.xml
${jetty.base}/etc/test-realm.xml
`