log4j2 + Java program in Intellij


I am using log4j2 as a logger and had no problems in the past. But now it seems that the log4j2.xml located in the resources directory, is not being read when my program is run inside Intelij.

I have no problems when I run the jar outside Intelij. I have externalized the log4j2.xml and the program is run with:

java -Dlog4j.configurationFile=file:"resources\log4j2.xml" -jar "C:\Programas\medlinetec\Lector\lector.jar"

I wonder if after updating Intelij, something has changed related to log4j2


评论操作 固定链接

There were no related changes in the IDE.

Please share a sample project to reproduce this issue: https://uploads.jetbrains.com.