Question
Is it possible to make Log4J display the full path of the file it used for configuration?
I have a
I am using Log4J2 and if you want to get the file from inside your Java Program this worked for me:
LoggerContext lContect = LogManager.getContext();
Field f = lContect.getClass().getDeclaredField("configuration");
f.setAccessible(true);
XmlConfiguration iWantThis = (XmlConfiguration) f.get(lContect);
System.out.println("Config File: " + iWantThis.getName());