title: Toggling text file logging in log4net
body: <p>In my Web app I want to have the ability to toggle text file logging on or off, is there a way within log4net for this to be accomplished?</p>
  
  <p>Right now I'm doing this in my log4net.config file, but this makes me think it's going to log in both places all the time:</p>
  
  <pre><code>&lt;appender name="EventLogAppender" type="log4net.Appender.EventLogAppender"&gt;
    &lt;param name="ApplicationName" value="Lending Service" /&gt;
    &lt;layout type="log4net.Layout.PatternLayout"&gt;
      &lt;conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message %newline %exception"  /&gt;
    &lt;/layout&gt;
    &lt;filter type="log4net.Filter.LevelRangeFilter"&gt;
      &lt;levelMin value="INFO"/&gt;
      &lt;levelMax value="FATAL"/&gt;
    &lt;/filter&gt; 
  &lt;/appender&gt;
  
  &lt;appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"&gt;
    &lt;file value="mylogfile.txt"/&gt;
    &lt;appendToFile value="true"/&gt;
    &lt;rollingStyle value="Size"/&gt;
    &lt;maxSizeRollBackups value="5"/&gt;
    &lt;maximumFileSize value="10MB"/&gt;
    &lt;staticLogFileName value="true"/&gt;
  
    &lt;layout type="log4net.Layout.PatternLayout"&gt;
      &lt;conversionPattern value="%date [%thread] %level %logger - %message%newline%exception"/&gt;
    &lt;/layout&gt;
  
  &lt;/appender&gt;
  
  &lt;root&gt;
    &lt;level value="DEBUG"/&gt;
    &lt;appender-ref ref="RollingFileAppender"/&gt;
    &lt;level value="ALL"/&gt;
    &lt;appender-ref ref="EventLogAppender" /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p><strong>EDIT</strong>
  I'm looking for a way to do this through a .config setting, whether it's something that needs to be added to the log4net.config or the web.config file.</p>