WildFly 8 Logging Levels

Martialshot picture Martialshot · Oct 8, 2014 · Viewed 13.1k times · Source

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"/>

Answer

James R. Perkins picture James R. Perkins · Oct 9, 2014

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.