Controlling stderr and stdout output in WildFly

試著忘記壹切 提交于 2019-12-07 09:59:34

问题


In my application I got used to the following debug output: normally it prints a few lines per request to stderr, but logs a lot of information (via log4j) to a file. Typically, most important thing for me is the stderr output (that's why I want it concise), but when something doesn't work as expected, I can investigate the log, which can easily be thousands line per request.

Now that I'm migrating the application to WildFly, I found that the server pipes all stderr output through its logging system, so it looks like this:

14:06:15,464 ERROR [stderr] (default task-13) ACTUAL-DEBUG-OUTPUT

and is additionally colored as an error. Also, stdout output seems to be redirected to /dev/null...

Can I somehow configure WildFly to just let stderr output go through as is, without adding useless (for me) noise and coloring? If possible, I'd like to do the same for stdout.


回答1:


OK, with some googling and hacking I got what I want:

/subsystem=logging/console-handler=JUST-PRINT:add(formatter="%s%E%n")
/subsystem=logging/logger=stderr:add(use-parent-handlers="false", handlers=[JUST-PRINT])
/subsystem=logging/logger=stdout:add(use-parent-handlers="false", handlers=[JUST-PRINT])


来源:https://stackoverflow.com/questions/28878736/controlling-stderr-and-stdout-output-in-wildfly

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