问题
How can I turn off the Logging of Grizzly?
I'd like to turn off following Loggings:
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.
Thanks in advance for any help/ advice.
回答1:
I wrote an own solution - I did everything by reflection:
Enumeration<String> loggers = LogManager.getLogManager().getLoggerNames();
while (loggers.hasMoreElements()) {
String loggerName = loggers.nextElement();
if(loggerName.contains("glassfish")) {
Logger logger = LogManager.getLogManager().getLogger(loggerName);
logger.setLevel(Level.OFF);
}
}
Consider that this will turn off all glassfish-Loggings.
来源:https://stackoverflow.com/questions/52868514/how-to-turn-off-grizzly-logging