WildFly 8 Logging Levels

拥有回忆 提交于 2019-12-07 04:10:14

问题


How do I modify the WildFly 8 logging levels, specifically server.log. Currently I suspect they default to INFO and would like to change it to Debug or Error.

For reference I've been exploring these articles

https://docs.jboss.org/author/display/WFLY8/Logging+Configuration

https://docs.jboss.org/author/display/WFLY8/How+To

And suspect this is correct;

<subsystem xmlns="urn:jboss:domain:logging:2.0">
            <console-handler name="CONSOLE">
                <level name="DEBUG"/>
                <formatter>
                    <named-formatter name="COLOR-PATTERN"/>

回答1:


By default the console-handler is set to INFO and the FILE handler does not have a level set. The root-logger is also set to INFO.

The instructions on the How To page you link so you how to add a new logger via CLI and assign it a level. If you were to add a new logger at a DEBUG level, then the server.log would get those log messages written to it.

If you want to change the root-logger to see DEBUG messages for all loggers that are not defined you can execute the following command.

/subsystem=logging/root-logger=ROOT:write-attribute(name=level,value=DEBUG)

If you want to also see messages on the console you need to change the level on the handler.

/subsystem=logging/console-handler=CONSOLE:write-attribute(name=level,value=DEBUG)

I wouldn't advocate using editing the XML. Using a management interface such as CLI or the web console is the appropriate way to change server settings.




回答2:


Just change the level of the root-logger and the one of the console logger. For a first shot this should work.



来源:https://stackoverflow.com/questions/26262702/wildfly-8-logging-levels

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