title: Delete old file using log4j
body: <p>In my application I use the library log4j to generate logs of the entire system. Is working correctly, use the following settings: </p>
  
  <p>Direct log messages to a log file:</p>
  
  <pre><code>log4j.appender.file = org.apache.log4j.DailyRollingFileAppender 
  log4j.appender.file.File = log / aplicacao.log 
  log4j.appender.file.DatePattern = '.' yyyy-MM-dd 
  log4j.appender.file.layout = org.apache.log4j.PatternLayout 
  log4j.appender.file.layout.ConversionPattern =% d {MM-dd-yyyy, HH: mm: ss: SSS},% t,%-5p,% c {1}:% L-% m% n 
  log4j.appender.file.MaxFileSize = 50KB 
  log4j.appender.file.MaxHistory = 2 
  </code></pre>
  
  <p>I wonder if there is some property that makes clear old files that already have more than a week, because if my system remain running for a long time is not feasible to occupy a lot of memory because the application that I developed is to be used on machines very old. </p>
  
  <p>Is there any solution for this? Maxfilesize and MaxHistory added the property and it does not work.</p>