title: Log4j2 not rolling over file, instead overriding the same file after SizeBasedTriggeringPolicy
body: <p>I have a following JSON config, which does not roll over after it reaches the max-size limit, rather overrides it.</p>
  
  <pre><code>{
    "configuration": {
      "name": "cool_log",
      "appenders": { "RollingFile": { "name": "rollingFile",
          "fileName": "/var/log/app_test.log",
          "filePattern": "/var/log/%d{MM-dd-yy-HH-mm-ss}-%i.log.gz",
          "JSONLayout": {
            "complete": false,
            "compact" : true,
            "eventEol": true
          },
          "Policies": { "SizeBasedTriggeringPolicy": { "size": "100 KB" } },
          "DefaultRolloverStrategy": { "max": "10" }
        }
      },
      "loggers": {
        "root": {
          "level": "DEBUG",
          "appender-ref": {
            "ref": "rollingFile"
          }
        }
      }
    }
  }
  </code></pre>
  
  <p>which I created based on <a href="https://logging.apache.org/log4j/2.x/manual/appenders.html#RollingFileAppender" rel="nofollow noreferrer">this official example</a>, </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="warn" name="MyApp" packages=""&gt;
    &lt;Appenders&gt;
      &lt;RollingFile name="RollingFile" fileName="var/log/app_test.log"
                   filePattern="logs/$${date:yyyy-MM}/app-%d{MM-dd-yyyy}-%i.log.gz"&gt;
        &lt;PatternLayout&gt;
          &lt;Pattern&gt;%d %p %c{1.} [%t] %m%n&lt;/Pattern&gt;
        &lt;/PatternLayout&gt;
        &lt;Policies&gt;
          &lt;TimeBasedTriggeringPolicy /&gt;
          &lt;SizeBasedTriggeringPolicy size="250 MB"/&gt;
        &lt;/Policies&gt;
        &lt;DefaultRolloverStrategy max="20"/&gt;
      &lt;/RollingFile&gt;
    &lt;/Appenders&gt;
    &lt;Loggers&gt;
      &lt;Root level="DEBUG"&gt;
        &lt;AppenderRef ref="RollingFile"/&gt;
      &lt;/Root&gt;
    &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>The <code>xml</code> config rolls over perfectly, but only this I'm missing is <code>PatternLayout</code>, which is <code>JSONLayout</code> for me.</p>
  
  <p>The setup for log4j2 is, </p>
  
  <pre><code>public static void initialiseLoggingConfiguration() {
          try {
              PropertiesConfiguration logConfig = new PropertiesConfiguration("app.properties");
              System.out.println("Setting up log4j2 " + logConfig.getString("log4j2.config"));
              Configurator.initialize(null, logConfig.getString("log4j2.config"));
          } catch (ConfigurationException e) {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>and maven dependencies, </p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
      &lt;artifactId&gt;log4j-api&lt;/artifactId&gt;
      &lt;version&gt;2.6.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
      &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
      &lt;version&gt;2.6.2&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
      &lt;artifactId&gt;log4j-web&lt;/artifactId&gt;
      &lt;version&gt;2.6.2&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>