How to Turn off Grizzly Logging?

自作多情 提交于 2021-02-10 16:48:52

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!