diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/ConsoleConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/ConsoleConfig.java index ba9558590ce3c..d0bd9bb3f7312 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/logging/ConsoleConfig.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/ConsoleConfig.java @@ -15,6 +15,12 @@ public class ConsoleConfig { @ConfigItem(defaultValue = "true") boolean enable; + /** + * If console logging should go to {@link System#err} instead of {@link System#out}. + */ + @ConfigItem(defaultValue = "false") + boolean stderr; + /** * The log format. Note that this value will be ignored if an extension is present that takes * control of console formatting (e.g. an XML or JSON-format extension). diff --git a/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java b/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java index 0caec179cb378..ab69e93e89cd6 100644 --- a/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java +++ b/core/runtime/src/main/java/io/quarkus/runtime/logging/LoggingSetupRecorder.java @@ -343,7 +343,8 @@ private static Handler configureConsoleHandler(final ConsoleConfig config, final } } } - final ConsoleHandler consoleHandler = new ConsoleHandler(ConsoleHandler.Target.SYSTEM_OUT, formatter); + final ConsoleHandler consoleHandler = new ConsoleHandler( + config.stderr ? ConsoleHandler.Target.SYSTEM_ERR : ConsoleHandler.Target.SYSTEM_OUT, formatter); consoleHandler.setLevel(config.level); consoleHandler.setErrorManager(defaultErrorManager); consoleHandler.setFilter(new LogCleanupFilter(filterElements));