title: How to get "max" attribute value of DefaultRolloverStrategy in log4j2 in Java
body: <p>I have one concern in log4j2. In the below appender definition, default rollover strategy is employed as shown below:</p>
  
  <pre><code> &lt;DefaultRolloverStrategy max="5" /&gt;
  </code></pre>
  
  <p>I need to access the value of <code>max</code> in java to do some customizations. Please help me about how this value can be retrieved. I can get the appender from the logger but I am not aware about how to get the <code>max</code> value of <code>DefaultRolloverStrategy</code> defined within this appender. </p>
  
  <pre><code>&lt;RollingFile name="TEST_FILE" fileName="${sys:LOGS}/test.log" filePattern="${sys:LOGS}/test.log.%i" append="true"&gt;
          &lt;PatternLayout&gt;
              &lt;pattern&gt;%d %-5p [%c{1}] [CustomData: %data] [%t] %m%n&lt;/pattern&gt;
          &lt;/PatternLayout&gt;
          &lt;Policies&gt;
              &lt;SizeBasedTriggeringPolicy size="500 KB" /&gt;
          &lt;/Policies&gt;
          &lt;DefaultRolloverStrategy max="5" /&gt;
          &lt;Filters&gt;
              &lt;ThresholdFilter level="DEBUG"/&gt;
                  &lt;ThresholdFilter level="OFF" onMatch="DENY" onMismatch="NEUTRAL"/&gt;              
          &lt;/Filters&gt;          
  </code></pre>
  
  <p></p>
  
  <p>Please help me. Thanks.</p>