Hi all,
I have an executable jar, and I run it with this command: java -jar .\my.jar if log42j.xml in my.jar, it is working, if log42.xml out of my.jar, it is not working. I try the “-Dlog4j.configurationFile” to load log4j2.xml like this: java -Dlog4j.configurationFile=.\log4j2.xml -jar .\ubbp-scheduled-1.0.2.jar then it shows erros: ERROR: cannot find or load the main class .configurationFile=.\log4j2.xml. it seems that the -D option cannot apply to the command: java -jar. So, is there anyway to load an external log4j2.xml when running a standalone application?