title: log4j2 xml configuration - Log to file and console (with different levels)
body: <p>I want to do two things:</p>
  
  <ol>
  <li>Log to console with a certain log-level</li>
  <li>Log to file with another log-level</li>
  </ol>
  
  <p>Console logging seems to work just fine but the log file keeps beeing empty.</p>
  
  <p>This is my log4j2.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration status="WARN"&gt;
    &lt;appenders&gt;
      &lt;Console name="Console" target="SYSTEM_OUT"&gt;
        &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt;
      &lt;/Console&gt;
  
      &lt;File name="MyFile" fileName="logs/app.log" immediateFlush="true"&gt;
          &lt;PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt;
      &lt;/File&gt;  
  
    &lt;/appenders&gt;
    &lt;loggers&gt;
  
      &lt;logger name="filelogger" level="error"&gt;
          &lt;appender-ref ref="MyFile"/&gt;
      &lt;/logger&gt;
  
      &lt;root level="info"&gt;
        &lt;appender-ref ref="Console"/&gt;
      &lt;/root&gt;
    &lt;/loggers&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>What might be wrong?</p>