WildFly 8 日志记录级别 [英] WildFly 8 Logging Levels
问题描述
如何修改 WildFly 8 日志记录级别,特别是 server.log.目前我怀疑他们默认为 INFO 并希望将其更改为 Debug 或 Error.
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/日志+配置
https://docs.jboss.org/author/display/WFLY8/How+To
并怀疑这是正确的;
<subsystem xmlns="urn:jboss:domain:logging:2.0">
<console-handler name="CONSOLE">
<level name="DEBUG"/>
<formatter>
<named-formatter name="COLOR-PATTERN"/>
推荐答案
默认情况下 console-handler
设置为 INFO
和 FILE
> 处理程序没有级别集.root-logger
也设置为 INFO
.
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
.
您链接的操作方法"页面上的说明可让您了解如何通过 CLI 添加新记录器并为其分配级别.如果您要在 DEBUG
级别添加新记录器,则 server.log
会将这些日志消息写入其中.
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.
如果您想更改 root-logger
以查看所有未定义记录器的 DEBUG
消息,您可以执行以下命令.
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)
我不提倡使用编辑 XML.使用 CLI 或 Web 控制台等管理界面是更改服务器设置的合适方法.
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.
这篇关于WildFly 8 日志记录级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!