title: Creating new Log file everyday and deleting previous log files
body: <p>I have one windows service. For Logging purpose in that service I am using Log4Net.dll. Now my requirement is that I want to create a new log file everyday and it should keep the log of only previous 7 days. Means on 8th day, it should delete first day file and use new file. I am using appender as:</p>
  
  <pre class="lang-xml prettyprint-override"><code> &lt;appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender"&gt;
      &lt;file type="log4net.Util.PatternString" value="D:\Log\%property{LogName}" /&gt;
       &lt;AppendToFile value="true" /&gt;
       &lt;rollingStyle value="Date" /&gt;      
       &lt;maxSizeRollBackups value="100" /&gt;       
       &lt;staticLogFileName value="false" /&gt;
       &lt;layout type="log4net.Layout.PatternLayout"&gt;
         &lt;conversionPattern value="%newline %date %-5level %C.%M() - %message" /&gt;
       &lt;/layout&gt;
   &lt;/appender&gt;
  </code></pre>
  
  <p>And at service startup I am configuring logger as: </p>
  
  <pre><code>log4net.GlobalContext.Properties["LogName"] = "App_" + DateTime.Now.ToString("MMddyyyy") + ".log";
  log4net.Config.XmlConfigurator.Configure();   
  </code></pre>
  
  <p>So is there any functionality of Log4Net that will achieve above functionality? Or is there any other way to do it? Any type of help will be appreciated.</p>