如何关闭 Grizzly 日志记录?

如何关闭 Grizzly 的日志记录?


我想关闭以下日志记录:


Okt 18, 2018 8:42:24 AM org.glassfish.grizzly.http.server.NetworkListener start

INFORMATION: Started listener bound to [0.0.0.0:8080]

Okt 18, 2018 8:42:24 AM org.glassfish.grizzly.http.server.HttpServer start

INFORMATION: [HttpServer] Started.

在此先感谢您的任何帮助/建议。


素胚勾勒不出你
浏览 141回答 1
1回答

手掌心

我写了一个自己的解决方案 - 我通过反思做了一切:&nbsp; &nbsp; Enumeration<String> loggers = LogManager.getLogManager().getLoggerNames();&nbsp; &nbsp; while (loggers.hasMoreElements()) {&nbsp; &nbsp; &nbsp; &nbsp; String loggerName = loggers.nextElement();&nbsp; &nbsp; &nbsp; &nbsp; if(loggerName.contains("glassfish")) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Logger logger = LogManager.getLogManager().getLogger(loggerName);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; logger.setLevel(Level.OFF);&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; }考虑到这将关闭所有 glassfish-Loggings。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java