Description
Describe the bug
When using Gradle with Quarkus tests, setting testLogging { showStandardStreams = false }
successfully suppresses System.out.println() calls but does not suppress Quarkus logger output. This causes unwanted log messages to appear in console output despite the explicit Gradle configuration to hide test streams.
The issue occurs because Gradle's SLF4JBridgeHandler processes JBoss LogManager's ExtLogRecord instances and outputs them to stdout, bypassing Gradle's stream control configuration. While Quarkus issue #22844 fixed duplicate/unformatted output, logger messages still bypass showStandardStreams = false.
Expected behavior
When testLogging { showStandardStreams = false }
is configured in Gradle, all test output including SLF4J logger messages should be suppressed from the console during test execution. The output should only appear in test reports (HTML/XML) for debugging purposes, maintaining clean CI/CD logs and reducing noise in build output.
Actual behavior
SLF4J logger output from Quarkus tests appears in the console despite showStandardStreams = false configuration. Direct System.out.println() calls are correctly suppressed, but logger messages like logger.info(), logger.error(), and logger output with exceptions bypass the Gradle configuration and appear in console output, creating noisy CI/CD logs.
How to Reproduce?
- Download attached reproducer
- Execute ./gradlew test --console=plain
- Observe that despite testLogging { showStandardStreams = false } in build.gradle.kts:
- Direct System.out.println() calls are suppressed (correct)
- SLF4J logger output appears in console (incorrect)
- Run ./demonstrate-issue.sh for a guided demonstration
The reproducer includes both @QuarkusTest and plain JUnit tests to show the difference in behavior.
quarkus-gradle-logging-issue.tar.gz
Output of uname -a
or ver
Darwin MacBookPro.localdomain 24.5.0 Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000 arm64
Output of java -version
openjdk version "21.0.6" 2025-01-21 LTS OpenJDK Runtime Environment Temurin-21.0.6+7 (build 21.0.6+7-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.6+7 (build 21.0.6+7-LTS, mixed mode, sharing)
Quarkus version or git rev
3.24.2
Build tool (ie. output of mvnw --version
or gradlew --version
)
------------------------------------------------------------ Gradle 8.14.2 ------------------------------------------------------------ Build time: 2025-06-05 13:32:01 UTC Revision: 30db2a3bdfffa9f8b40e798095675f9dab990a9a Kotlin: 2.0.21 Groovy: 3.0.24 Ant: Apache Ant(TM) version 1.10.15 compiled on August 25 2024 Launcher JVM: 21.0.6 (Eclipse Adoptium 21.0.6+7-LTS) Daemon JVM: /Library/Java/JavaVirtualMachines/temurin-21.jdk/Contents/Home (no JDK specified, using current Java home) OS: Mac OS X 15.5 aarch64
Additional information
No response