From 691b0429d2aaf0f04d3944706193b8cdaf4c4405 Mon Sep 17 00:00:00 2001 From: "James R. Perkins" Date: Mon, 10 Jun 2024 11:34:45 -0700 Subject: [PATCH] [WFCORE-6850] Set a JDKModuleLogger after the log manager is configured. https://issues.redhat.com/browse/WFCORE-6850 Signed-off-by: James R. Perkins --- .../main/java/org/wildfly/core/jar/runtime/BootableJar.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootable-jar/runtime/src/main/java/org/wildfly/core/jar/runtime/BootableJar.java b/bootable-jar/runtime/src/main/java/org/wildfly/core/jar/runtime/BootableJar.java index 02274121a1c..4fd278d4bc8 100644 --- a/bootable-jar/runtime/src/main/java/org/wildfly/core/jar/runtime/BootableJar.java +++ b/bootable-jar/runtime/src/main/java/org/wildfly/core/jar/runtime/BootableJar.java @@ -58,6 +58,7 @@ import org.jboss.logmanager.Configurator; import org.jboss.logmanager.LogContext; import org.jboss.logmanager.PropertyConfigurator; +import org.jboss.modules.Module; import org.jboss.modules.ModuleClassLoader; import org.jboss.modules.ModuleLoader; import static org.wildfly.core.jar.runtime.Constants.LOG_BOOT_FILE_PROP; @@ -66,6 +67,7 @@ import static org.wildfly.core.jar.runtime.Constants.STANDALONE_CONFIG; import org.jboss.modules.ModuleLoggerFinder; +import org.jboss.modules.log.JDKModuleLogger; import org.jboss.stdio.LoggingOutputStream; import org.jboss.stdio.NullInputStream; import org.jboss.stdio.SimpleStdioContextSelector; @@ -217,6 +219,8 @@ private void configureLogging() throws IOException { LogContext ctx = configureLogContext(); // Use our own LogContextSelector which returns the configured context. LogContext.setLogContextSelector(() -> ctx); + // Set a new JDK module logger to replace the default NoopModuleLogger + Module.setModuleLogger(new JDKModuleLogger()); // Make sure our original stdio is properly captured. try {