title: Is there a way to have log4net create log file only when there is logging activity?
body: <p>We changed our log4net file name to include the current date but only want log files created on those dates that there is logged activity. This is our current configuration:</p>
  
  <pre><code>&lt;log4net&gt;
      &lt;appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"&gt;
          &lt;file type="log4net.Util.PatternString" value="{0}\\logfiles\\log%date{{yyyyMMdd}}-${{COMPUTERNAME}}.log" /&gt;
          &lt;appendToFile value="true" /&gt;
          &lt;lockingModel type="log4net.Appender.FileAppender+MinimalLock" /&gt; 
          &lt;rollingStyle value="Size" /&gt;
          &lt;maxSizeRollBackups value="10" /&gt;
          &lt;maximumFileSize value="10MB" /&gt;
          &lt;staticLogFileName value="true" /&gt;
          &lt;layout type="log4net.Layout.PatternLayout"&gt;
              &lt;conversionPattern value="%date %-5level %logger %message%newline" /&gt;
          &lt;/layout&gt;
      &lt;/appender&gt;
      &lt;root&gt;
          &lt;level value="WARN" /&gt;
          &lt;appender-ref ref="RollingFileAppender" /&gt;
      &lt;/root&gt;
  &lt;/log4net&gt;
  </code></pre>
  
  <p>It's producing empty files on days when the logger is created but no messages of WARN or greater are written. Is there a configuration to prevent empty files?</p>