I have a problem concerning log4j2 which does not load the log4j2.xml
configuration file in a project.
The project is bundled into an uber jar file. When running the application using java -jar jarfile.jar
the application starts but log4j prints the following error to the console:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
I checked the jar and it definitely contains a log4j2.xml
file in the root location.
Because I could not figure out why this does not work I debugged to log4j2 bootstrap code. I found out that log4j never tries to read the log4j2.xml. This should happen in org.apache.logging.log4j.core.config.ConfigurationFactory.Factory#getConfiguration.
Unfortunately the list of factories used in this method is empty thus the method always returns null.
Any ideas on this?
If you want to check this clone https://github.com/cryptomator/cryptomator, cd to the main directory in the cloned repo and run mvn clean install -DskipTests -P uber-jar
afterwards you will find the jar file in question under main/uber-jar/target.