Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot bind log4j to slf4j / multiple SLF4J bindings #1332

Closed
raoulduke98 opened this issue Jun 13, 2023 · 2 comments
Closed

Cannot bind log4j to slf4j / multiple SLF4J bindings #1332

raoulduke98 opened this issue Jun 13, 2023 · 2 comments

Comments

@raoulduke98
Copy link

raoulduke98 commented Jun 13, 2023

I'm using BIRT Runtime 4.13 in a Java Web Application which is built and managed with gradle. I want to integrate Java Util Logging as well as Log4J via SLF4J. Therefore, I add dependencies to my project:

// parts of birt runtime run with java util logging
api "org.slf4j:jul-to-slf4j:${slf4jBridgeVersion}"
// log4j2 in my app
api "org.apache.logging.log4j:log4j-api:${log4jVersion}"
api "org.apache.logging.log4j:log4j-core:${log4jVersion}"
// bind slf4j to log4j2
api "org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}"

For correct usage of JUL, I added this to my Java code:
SLF4JBridgeHandler.install()

However, I receive a "Multiple SLF4J bindings" error at runtime:

[err] SLF4J: Class path contains multiple SLF4J bindings.
[err] SLF4J: Found binding in [wsjar:file:/C:/Users/***/.gradle/caches/modules-2/files-2.1/org.eclipse.birt.runtime/org.eclipse.birt.runtime/4.13.0/***/org.eclipse.birt.runtime-4.13.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[err] SLF4J: Found binding in [wsjar:file:/C:/Users/***/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.20.0/***/log4j-slf4j-impl-2.20.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]

I think it might be a problem that BIRT Runtime has integrated SLF4J code directly in its source code.
How can I resolve this?

@speckyspooky
Copy link
Contributor

The issue is caused on the Cassandra-datasource - see #951

@speckyspooky
Copy link
Contributor

The Cassandra Scripted Data Source incl. Hector-runtime is removed with PR #1419
and will be available with BIRT 4.14

With the removed jars and classes should be also solved the SLF4J-issue.

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

No branches or pull requests

2 participants