[英]how can i turn off jetty debuging?
我有一個運行碼頭的Java應用程序:
public class ServerRunner {
private final static org.apache.log4j.Logger logger = LoggingUtils.getLogger();
public static void main(String[] args) throws Exception {
PromptoConfig.s.initLog();
final int port = 8082;
final Server jettyServer = new Server(port);
final HandlerCollection handlers = new HandlerCollection();
// Creating the first web application context
final WebAppContext webappContext = new WebAppContext();
System.out.println("===== PromptoConfig.s.RESOURCES_BASE " + PromptoConfig.s.RESOURCES_BASE);
webappContext.setResourceBase(PromptoConfig.s.RESOURCES_BASE);
webappContext.setContextPath("/");
System.out.println("===== PromptoConfig.s.WEB_XML_PATH " + PromptoConfig.s.WEB_XML_PATH);
webappContext.setDefaultsDescriptor(PromptoConfig.s.WEB_XML_PATH);
// webappContext.setTempDirectory(new File(temp));
DBSQLConfig.s().DB = com.waze.prompto.config.DBSQLConfig.s.DB;
webappContext.setExtractWAR(false);
handlers.addHandler(webappContext);
// Adding the handlers to the server.
jettyServer.setHandler(handlers);
try {
jettyServer.start();
jettyServer.join();
} catch (Exception ex) {
logger.error("failed to init jetty server", ex);
} finally {
jettyServer.destroy();
}
}
}
我在intellij控制台的日志調試信息中看到:
633016 [org.eclipse.jetty.server.session.HashSessionManager@22fcf7abTimer] DEBUG org.eclipse.jetty.server.session - Scavenging sessions at 1496325042425
如何關閉此調試日志?
您似乎已在您的環境中配置了log4j。
private final static org.apache.log4j.Logger logger = LoggingUtils.getLogger();
輸出格式也不是Jetty內部StdErrLog
的默認格式
你的
633016 [org.eclipse.jetty.server.session.HashSessionManager@22fcf7abTimer] DEBUG org.eclipse.jetty.server.session - Scavenging sessions at 1496325042425
碼頭的StdErrLog
2017-06-01 14:30:17.978:DBUG:oejs.session:main: SessionManager default maxInactiveInterval=1800
此時,這不再是碼頭日志記錄配置,而是log4j配置。
只需在log4j.properties
或log4j.xml
中將org.eclipse.jetty
記錄器級別設置為INFO或WARN
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.