title: how to roll out file every hour with max given files in log4j2
body: <p>I want to roll out file on hourly basis and want to keep max 3 file , below are the configuration . But its not executing properly. can anyone help .</p>
  
  <pre><code>&lt;RollingFile name="LogFile" fileName="logs/server.log" immediateFlush="false" append="true"
          filePattern="logs/server-%d{yyyy-MM-dd-HH}.log"&gt;
          &lt;PatternLayout&gt;
              &lt;Pattern&gt;&amp;lt;%d{MMM d, yyyy hh:mm:ss a}&amp;gt; &amp;lt;%5p&amp;gt; - %m%n&lt;/Pattern&gt;
          &lt;/PatternLayout&gt;
          &lt;Policies&gt;
                  &lt;TimeBasedTriggeringPolicy interval="1" modulate="true"/&gt;
                  &lt;!--    &lt;SizeBasedTriggeringPolicy size="5 KB" /&gt; --&gt;
          &lt;/Policies&gt;
          &lt;DefaultRolloverStrategy max="3" /&gt;
  &lt;/RollingFile&gt;
  </code></pre>