#3068 shouldn't declare a dependency on SLF4J binding
Closed: migrated 3 years ago by dmoluguw. Opened 5 years ago by tjaalton.

From https://www.slf4j.org/codes.html#multiple_bindings

"Embedded components such as libraries or frameworks should not declare a dependency on any SLF4J binding but only depend on slf4j-api. When a library declares a compile-time dependency on a SLF4J binding, it imposes that binding on the end-user, thus negating SLF4J's purpose. When you come across an embedded component declaring a compile-time dependency on any SLF4J binding, please take the time to contact the authors of said component/library and kindly ask them to mend their ways."

noticed it when our resteasy had slf4j-simple.jar in it's classpath, and dogtag had -jdk14.jar:

loka 10 01:06:22 sid2.leon pki-tomcatd[13563]: SLF4J: Class path contains multiple SLF4J bindings.
loka 10 01:06:22 sid2.leon pki-tomcatd[13563]: SLF4J: Found binding in [jar:file:/usr/share/java/slf4j-simple.jar!/org/slf4j/impl/StaticLoggerBinder.class]
loka 10 01:06:22 sid2.leon pki-tomcatd[13563]: SLF4J: Found binding in [jar:file:/usr/share/java/slf4j-jdk14.jar!/org/slf4j/impl/StaticLoggerBinder.class]
loka 10 01:06:22 sid2.leon pki-tomcatd[13563]: SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
loka 10 01:06:22 sid2.leon pki-tomcatd[13563]: SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]


I'm not sure this ticket is valid.

AFAIK the PKI code does not have any explicit dependency on specific SLF4J binding. Some PKI code uses JUL API to set the logging level programmatically, but it should be possible to build PKI binaries without slf4j-jdk14. The pki.spec file does include a build dependency on slf4j-jdk14 because it is running the unit tests as part of the build process, but the PKI code itself does not depend on it.

If someone wants to include PKI library in their application, it should be possible to use any SLF4J binding by specifying it in the classpath of that application. However, in PKI applications (server, tools, tests) we specifically use slf4j-jdk14 in the classpath, so all other libraries (including RESTEasy) running in PKI applications will have to use this binding too.

Metadata Update from @edewata:
- Custom field component adjusted to None
- Custom field feature adjusted to None
- Custom field origin adjusted to None
- Custom field proposedmilestone adjusted to None
- Custom field proposedpriority adjusted to None
- Custom field reviewer adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None

5 years ago

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/3186

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Metadata Update from @dmoluguw:
- Issue close_status updated to: migrated
- Issue status updated to: Closed (was: Open)

3 years ago

Login to comment on this ticket.

Metadata