Skip to content

Fix[Build]: restore test logging, default to WARN - #177

Merged
678098 merged 1 commit into
bloomberg:mainfrom
678098:261106_log4j2
Nov 6, 2026
Merged

678098 merged 1 commit into
bloomberg:mainfrom
678098:261106_log4j2

Conversation

@678098

@678098 678098 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Logs never showed up when tests ran in CI. slf4j-api 2.x does not support the old log4j-slf4j-impl bridge, which was written for slf4j 1.7. It skipped that bridge and used the no-op logger, so every log call did nothing.

Changes:

  • Switch to log4j-slf4j2-impl, the log4j bridge for slf4j 2.x (sdk tests and examples).
  • Set the default test log level to WARN. Use -Dbmq.log.level=info (or debug) for more detail.

Before

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.bloomberg.bmq.it.BrokerSessionIT
SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
SLF4J(W): Class path contains SLF4J bindings targeting slf4j-api versions 1.7.x or earlier.
SLF4J(W): Ignoring binding found at [jar:file:/home/runner/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.26.1/log4j-slf4j-impl-2.26.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J(W): See https://www.slf4j.org/codes.html#ignoredBindings for an explanation.
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
[WARNING] Tests run: 38, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 272.9 s -- in com.bloomberg.bmq.it.BrokerSessionIT

After

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.bloomberg.bmq.it.BrokerSessionIT
20:15:00,900 (pool-3-thread-1) WARN SystemUtil:64 HOSTNAME env variable is not set, using 'localhost'
20:15:01,055 (pool-3-thread-1) ERROR OpenQueueStrategy:82 Open queue failed: {"rId":3,"status":{"category":"E_UNKNOWN","code":0,"message":""}}
20:15:03,059 (pool-3-thread-1) ERROR OpenQueueStrategy:82 Open queue failed: {"rId":4,"status":{"category":"E_TIMEOUT","code":0,"message":""}}
20:15:21,125 (pool-3-thread-1) ERROR LateResponseHandler:65 Inappropriate late response received: {"rId":35,"closeQueueResponse":{}}
20:15:26,158 (pool-5-thread-1) WARN SystemUtil:64 HOSTNAME env variable is not set, using 'localhost'
20:15:36,223 (pool-7-thread-1) WARN SystemUtil:64 HOSTNAME env variable is not set, using 'localhost'
20:15:36,227 (pool-7-thread-1) ERROR StandaloneConfigureQueueStrategy:40 Queue is not opened.
20:15:36,227 (pool-7-thread-1) ERROR QueueControlStrategy:159 Precondition for starting sequence failed.

@678098
678098 requested a review from a team as a code owner November 6, 2026 20:13
@678098
678098 requested a review from chrisbeard November 6, 2026 20:27
Logs never showed up when tests ran in CI. slf4j-api 2.x does not support the old log4j-slf4j-impl bridge,
which was written for slf4j 1.7. It skipped that bridge and used the no-op logger, so every log call did
nothing.

Changes:
- Switch to log4j-slf4j2-impl, the log4j bridge for slf4j 2.x (sdk tests and examples).
- Set the default test log level to WARN. Use -Dbmq.log.level=info (or debug) for more detail.

Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
@678098
678098 merged commit 8717491 into bloomberg:main Nov 6, 2026
19 of 20 checks passed
@678098
678098 deleted the 261106_log4j2 branch November 6, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants