title: External log4j configuration file not loaded from executable jar
body: <p>I need to import my log4j2 configuration file at runtime once the user gives a parameter pointing to the path where the configuration file is located (I cannot use the -Dlog4j.configurationFile parameter).</p>
  <p>All works fine when the code is executed inside Eclipse IDE, the configuration is correctly loaded from the external file, passed as parameter by the user.
  Once i build the jar file, the same piece of code does not work and configuration of the external file is not correctly loaded for my logs.</p>
  <p>The path to the log file is given as absolute path.</p>
  <p>Log4j2 version: 2.11</p>
  <p>Here is the code that i'm currently using:</p>
  <pre><code> public static void main(String[] args) {
                      LoggerContext context = (LoggerContext) LogManager.getContext(false);
                      File file = new File(args[0]);
                      context.setConfigLocation(file.toURI());
                      .....................
          }
  </code></pre>
  <p>args[0] contains the absolute path to the log4j2 configuration file.</p>
  <p>Any idea of what i am doing wrong?
  Thank you</p>