Jetty: how to disable logging?

前端 未结 7 1910
隐瞒了意图╮
隐瞒了意图╮ 2020-12-30 02:35

I am trying to embed Jetty 6.1 in another program. Jetty is dumping INFO-log information and I need to turn it off. Is there a simple way to disable logging programmaticaly?

7条回答
  •  梦毁少年i
    2020-12-30 03:02

    Use this

    org.eclipse.jetty.util.log.Log.setLog(new jettyNoLog());
    Logger.getLogger(jettyNoLog.class.getName()).setLevel(Level.OFF);
    org.eclipse.jetty.util.log.Log.getProperties().setProperty("org.eclipse.jetty.LEVEL", "OFF");
    org.eclipse.jetty.util.log.Log.getProperties().setProperty("org.eclipse.jetty.util.log.announce", "false");
    org.eclipse.jetty.util.log.Log.getRootLogger().setDebugEnabled(false);
    

提交回复
热议问题