title: Can Log4Net Delete Log Files Automatically?
body: <p>I am using log4net RollingFileAppender in a windows service program written in C#. The number and size of files in logs directory is growing too fast, need cleanup. The configuration is below:</p>
  
  <pre><code>&lt;appender name="Rolling Log" type="log4net.Appender.RollingFileAppender"&gt;
  &lt;file value="..\logs\MyProgram.%cs{instanceName}.log" /&gt;
  &lt;appendToFile value="true" /&gt;
  &lt;rollingStyle value="Composite" /&gt;
  &lt;datePattern value=".yyyy-MM-dd.lo\g" /&gt;
  &lt;maxSizeRollBackups value="10" /&gt;
  &lt;maximumFileSize value="150MB" /&gt;
  &lt;layout type="log4net.Layout.PatternLayout"&gt;
    &lt;conversionPattern value="%date [%-5level] %property{remoteUser} [%threadIdentity] %type{1}.%method - %message%newline%exception" /&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p></p>
  
  <p>I only want to keep 30 days of logs. How can I configure log4net to delete the logs automatically? If not available through log4net, what solutions would I have?</p>
  
  <p>Thank you in advance.</p>