简体   繁体   中英

Suppress embedded Jetty server version

Would it be possible to hide the following output produced by Jetty?

2012-04-08 10:52:35.467:INFO:oejs.Server:jetty-8.y.z-SNAPSHOT
2012-04-08 10:52:35.623:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:4725

I have tried configuring the server with the xml, but turns out this output is not redirected with the following gist: http://docs.codehaus.org/display/JETTY/StdErrStdOut .

You are using Jetty 8, the documentation is located at http://wiki.eclipse.org/Jetty/

Jetty writes this info during startup of the Server

LOG.info("jetty-"+__version);

If you use the StdErr Logger, ie there is no SLF4J Logging Framework on your classpath, you can use the system property

org.eclipse.jetty.LEVEL

to configure the the log level. org.eclipse.jetty.LEVEL supports the LogLevels ALL|DEBUG|INFO|WARN.

For further information about Jetty 7,8.x and how to use external logging frameworks with jetty have a look at Jetty Logging

Set the StdErrLog level to WARN , before starting your server:

Properties p = new Properties();
p.setProperty("org.eclipse.jetty.LEVEL", "WARN");
org.eclipse.jetty.util.log.StdErrLog.setProperties(p);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM