Using epublib-core in a springboot application causes two issues:
a warning: Class Path Contains Multiple SLF4J Bindings -- this can be ignored
IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath
The problem seems to me, the slf4j-simple binding (provider) inherited from the parent pom.
Considering the core library intention as a client, it might be better served by just using the sl4j-api and omitting the binding (provider). From baeldung:
It is worth noting that embedded components such as libraries or frameworks should never declare a dependency on any SLF4J binding. This is because when a library declares a compile-time dependency on an SLF4J binding, it imposes that binding on the end-user. Obviously, this negates SLF4J's basic purpose. Consequently, they should only depend on the slf4j-api library.
A commonly proposed solution is to add to your gradle build file:
Using epublib-core in a springboot application causes two issues:
The problem seems to me, the slf4j-simple binding (provider) inherited from the parent pom. Considering the core library intention as a client, it might be better served by just using the sl4j-api and omitting the binding (provider). From baeldung:
A commonly proposed solution is to add to your gradle build file:
However, this disables logging configuration for the entire app. On the other hand, this doesn't seem to work:
The solution that worked for me was to:
Now it no longer has a conflict and spring boot logging will work as expected.