In the documentation for slf4j it says that the binding happens during complie time:
\"SLF4J does not rely on any special class loader machinery. In fact, each SLF4J bi
It's just as @Rad said.
What I wanna replenish is that if you have multiple StaticLoggerBinder
implements in your runtime environment, slf4j choose one of them RANDOMLY, as said in multiple_bindings:
The way SLF4J picks a binding is determined by the JVM and for all practical purposes should be considered random. As of version 1.6.6, SLF4J will name the framework/implementation class it is actually bound to.
Another attention is that if your project is planned to be a library for other projects, only slf4j-api
should be included, any implementation for slf4j-api
is not allowed:
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.