title: Log4j2: file logging not working with jar
body: <p>I have a java application with log4j2 configured in order to log to console and to file.
  When i start my application from ecplise, all the log are ok (console and file).</p>
  
  <p>When i start the jar of the application from CMD or Powershell (as admin), only the console log works.
  If i start the jar by only double click, the file log works (but no console is displayed).</p>
  
  <p>This my log4j2.xml configuration:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="INFO"&gt;
  
  &lt;Appenders&gt;
  
  &lt;File name="file_all" fileName="logs/ALL.log"&gt;
    &lt;PatternLayout&gt;
      &lt;Pattern&gt;%d{yyyy-MM-dd HH:mm:ss} [%t] %-5level %logger{36} - %msg%n&lt;/Pattern&gt;
    &lt;/PatternLayout&gt;
  &lt;/File&gt;
  
  &lt;File name="file_error" fileName="logs/ERROR.log"&gt;
    &lt;PatternLayout&gt;
      &lt;Pattern&gt;%d{yyyy-MM-dd HH:mm:ss} [%t] %-5level %logger{36} - %msg%n&lt;/Pattern&gt;
    &lt;/PatternLayout&gt;
  &lt;/File&gt;
  
  &lt;Console name="STDOUT" target="SYSTEM_OUT"&gt;
    &lt;PatternLayout pattern="%d{HH:mm:ss} [%t] %-5level %logger{36} - %msg%n"/&gt;
  &lt;/Console&gt;
  
  &lt;/Appenders&gt;
  
  &lt;Loggers&gt;
  
  &lt;Root level="trace"&gt;
    &lt;AppenderRef ref="file_all" level="INFO"/&gt;
    &lt;AppenderRef ref="file_error" level="ERROR"/&gt;
    &lt;AppenderRef ref="STDOUT" level="INFO"/&gt;
  &lt;/Root&gt;
  &lt;/Loggers&gt;
  
  &lt;/Configuration&gt;
  </code></pre>