In my project I use customer libraries. Inside these libraries use
I like logback. Is it possible to use
slf4j in my project at this case?
I want to use all features of logback, especially dynamic configuration update.
I assume you mean those libraries you use have explicit calls to log4j Loggers.
In that case, using slf4j + logback as your logging implementation and including the log4j calls is quite simple.
As the slf4j documentation says, you just have to replace all the log4j dependencies with a single one from slf4j, named log4j-over-slf4j: http://slf4j.org/legacy.html#log4j-over-slf4j.
In case you are using maven the correct dependency is:
<dependency> <groupId>org.slf4j</groupId> <artifactId>log4j-over-slf4j</artifactId> <version>1.7.21</version> </dependency>
Any code that is under your direct control can just use slf4j + logback as it always would.