4

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 Answers1

5

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])
  • Did it really remove stderr messages from your log system? I would like to do the same, but I'm using Thorntail (wildfly for microservices). Do you how to set a Thorntail's yaml configuration file to make it work? – Fernando Costa Jan 16 '19 at 21:04