I have a maven project with log4j2 (2.9.0) and a configuration file in /src/main/java/resources/log4j2.xml
. As long as I stay in IntelliJ this works fine and it logs just like I configured it.
If I now make a mvn clean install
in the terminal (Ubuntu 14) and then start the main method of my program in IntelliJ, I will get an error that it won't find the log4j2 configuration file:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.
As soon as I make Build -> Rebuild Project
in IntelliJ IDEA it will work again.
I don't really understand how an external maven build could confuse IntelliJ IDEA to not take the .xml in the local source code.
Any idea?