title: Can we delete the logs older than certain days in log4j other than using MaxBackupIndex
body: <p>I am using log4j in my application and the logs are getting generated using this framework. </p>
  
  <p>I wanted to delete the logs which are older than 10 days as the logs size is increasing rapidly. </p>
  
  <p>I am aware of the MaxFileSize and MaxBackupIndex which generally deletes based on the number of files generated but my requirement is to delete the logs which are older than certain days. Do we have any option in log4j for this or do we need use some unix script like below and clear the logs?</p>
  
  <pre><code>find -type f -mtime +7 -exec rm -f {} \;
  </code></pre>
  
  <p>Thanks
  Harsha GNS</p>