title: log4j2 file not writing to file
body: <p>I've been searching the web for days now but somehow nothing seems to help.
  I try to migrate from log4j 1.x to log4j 2 but something is not right here and I hope one of you can help.</p>
  
  <p>I have a JSF application running on Websphere 8 and this is is my configuration so far:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
     &lt;Configuration&gt;
      &lt;Filter type="ThresholdFilter" level="trace"/&gt;
      &lt;Appenders&gt;
          &lt;RollingFile name="DEBUG" filePattern="C:/Files/varm_debug.%d{yyyy-MM-dd}.log" fileName="C:/Files/varm_debug.log" append="true"&gt;
              &lt;PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} ;%-5p; [%c{1}.%M]; %m%n"/&gt;
              &lt;Policies&gt;
                  &lt;SizeBasedTriggeringPolicy size="1500KB"/&gt;
              &lt;/Policies&gt;
              &lt;DefaultRolloverStrategy max="20"/&gt;
              &lt;ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/&gt;
          &lt;/RollingFile&gt;
          &lt;RollingFile name="INFO" filePattern="C:/Files/varm_info.%d{yyyy-MM-dd}.log" fileName="C:/Files/varm_info.log" append="true"&gt;
              &lt;PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} ;%-5p; [%c{1}.%M]; %m%n"/&gt;
              &lt;Policies&gt;
                  &lt;SizeBasedTriggeringPolicy size="1500KB"/&gt;
              &lt;/Policies&gt;
              &lt;DefaultRolloverStrategy max="20"/&gt;
              &lt;ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/&gt;
          &lt;/RollingFile&gt;
  
          &lt;RollingFile name="WARN" filePattern="C:/Files/varm_warn.%d{yyyy-MM-dd}.log" fileName="C:/Files/varm_warn.log" append="true"&gt;
              &lt;PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} ;%-5p; [%c{1}.%M]; %m%n"/&gt;
              &lt;Policies&gt;
                  &lt;SizeBasedTriggeringPolicy size="500KB"/&gt;
              &lt;/Policies&gt;
              &lt;DefaultRolloverStrategy max="20"/&gt;
              &lt;ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/&gt;
          &lt;/RollingFile&gt;
  
          &lt;RollingFile name="ERROR" filePattern="C:/Files/varm_error.%d{yyyy-MM-dd}.log" fileName="C:/Files/varm_error.log" append="true"&gt;
              &lt;PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} ;%-5p; [%c{1}.%M]; %m%n"/&gt;
              &lt;Policies&gt;
                  &lt;SizeBasedTriggeringPolicy size="500KB"/&gt;
              &lt;/Policies&gt;
              &lt;DefaultRolloverStrategy max="20"/&gt;
              &lt;ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/&gt;
          &lt;/RollingFile&gt;
  
  
          &lt;File name="comparisonLogAppender" fileName="C:/Files/VARM-output.log" append="true"&gt;
              &lt;PatternLayout pattern="%d{ISO8601}; %m%n"/&gt;
          &lt;/File&gt;
      &lt;/Appenders&gt;
      &lt;Loggers&gt;
      &lt;!-- Logger to compare results --&gt;
  
          &lt;!--  Logger to log infos/errors throughout comparison --&gt;
          &lt;Logger name="comparisonLogger" level="trace"  additivity="true" immediateFlush="true"&gt;
              &lt;AppenderRef ref="comparisonLogAppender"/&gt;
  
          &lt;/Logger&gt;
  
          &lt;Logger name="de.saltsolutions.varm" level="info" &gt;
              &lt;AppenderRef ref="DEBUG" level="debug"/&gt;
              &lt;AppenderRef ref="INFO" level="info"/&gt;
              &lt;AppenderRef ref="WARN" level="warn"/&gt;
              &lt;AppenderRef ref="ERROR" level="error"/&gt;
          &lt;/Logger&gt;
          &lt;Logger name="org.hibernate" level="warn"&gt;
                      &lt;AppenderRef ref="DEBUG" level="debug"/&gt;
              &lt;AppenderRef ref="INFO" level="info"/&gt;
              &lt;AppenderRef ref="WARN" level="warn"/&gt;
              &lt;AppenderRef ref="ERROR" level="error"/&gt;
          &lt;/Logger&gt;
          &lt;Root level="debug"&gt;
              &lt;AppenderRef ref="DEBUG" level="debug"/&gt;
          &lt;/Root&gt;
          &lt;Root level="info"&gt;
              &lt;AppenderRef ref="INFO" level="info"/&gt;
          &lt;/Root&gt;
          &lt;Root level="warn"&gt;
              &lt;AppenderRef ref="WARN" level="warn"/&gt;
          &lt;/Root&gt;
          &lt;Root level="error"&gt;
              &lt;AppenderRef ref="ERROR" level="error"/&gt;
          &lt;/Root&gt;
      &lt;/Loggers&gt;
  
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>All the files are generated okay but they stay empty.
  My main problem is the comparisonLogger. If I use it (LogManager.getLogger("comparisonLogger") in my main class, it writes the log file perfectly.
  But when I try using the exact same logger in my ManagedBean (ViewScoped) nothing gets logged.</p>
  
  <p>Does anybody know why it doesn't work in my ManagedBean? Does this have anything to do with the Websphere?</p>
  
  <p>I hope anybody can help because I have absolutely no idea what I could possibly do to make this work.</p>
  
  <p>Thanks so much in advance</p>