When using Infinispan (or any other jBoss library for that matter) and Logback in the same project you may end up getting this warning when running the project:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console
Maybe you log to a persistent storage and you may miss important error messages, because they are logged to the console.
Solution 1: Start the application with specific parameter
One solution is to add the following parameter when starting the application:
-Dorg.jboss.logging.provider=
slf4j
The relevant code is in org.jboss.logging.
Solution 2: Exclude log4j libraries from classpath
Another solution is to exclude all logging related classes from the classpath, as in org.jboss.logging.
When using gradle it is enough to add the following into build.gradle
configurations {
all*.exclude group: ‘org.apache.logging.log4j’
all*.exclude group: ‘org.apache.log4j’
all*.exclude group: ‘org.jboss.logmanager’
}