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"/>
By default, JBoss produces output to both the console and a log file ( log/server. log ). There are six basic log levels in log4j: TRACE , DEBUG , INFO , WARN , ERROR and FATAL .
By default WildFly uses a periodic log handler and will create a log for every calendar day. This is different than WebSphere or Jboss, and may not be the desired format for many customers. Luckily WildFly has highly customizable logging. Open the WildFly Admin Console (http://<host>:9990/console by default).
Reading WildFly logs from HTTP You can test it by opening the browser and issuing the following: http://localhost:9990/management/subsystem/logging/log-file/server.log?operation=attribute&name=stream&useStreamAsResponse&user=admin&password=mYpassword1!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With