title: ConfigurationErrorsException when adding log4net configuration to the app.config
body: <p>I am testing log4net; it is really working well. But when I add the log4net configuration to the app.config for my application, it throws a <code>ConfigurationErrorsException</code>. here is my app.config file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;configsections&gt;
      &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,     log4net" /&gt;
    &lt;/configsections&gt;
    &lt;log4net&gt;
      &lt;!-- Set root logger level to DEBUG and its only appender to A1 --&gt;
      &lt;root&gt;
        &lt;level value="ERROR" /&gt;
        &lt;appender-ref ref="RollingLogFileAppender" /&gt;
      &lt;/root&gt;
      &lt;appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"&gt;
        &lt;lockingModel type="log4net.Appender.FileAppender+MinimalLock"/&gt;
        &lt;file value="c:\log\" /&gt;
        &lt;datePattern value="yyyy-MM-dd'_siteAgent.log'" /&gt;
        &lt;staticLogFileName value="false" /&gt;
        &lt;appendToFile value="true" /&gt;
        &lt;rollingStyle value="Composite" /&gt;
        &lt;maxSizeRollBackups value="10" /&gt;
        &lt;maximumFileSize value="5MB" /&gt;
        &lt;layout type="log4net.Layout.PatternLayout"&gt;
          &lt;conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] -     %message%newline" /&gt;
        &lt;/layout&gt;
      &lt;/appender&gt;
    &lt;/log4net&gt;
    &lt;appSettings&gt;
      &lt;add key ="test" value="tttt"/&gt;
    &lt;/appSettings&gt;
  &lt;/configuration&gt;    
  </code></pre>
  
  <p>and code below  </p>
  
  <pre><code>using System;
  using System.Configuration;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  namespace LogTest
  {
      class Program
      {
          private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);  
  
          static void Main(string[] args)
          {
              string t = ConfigurationManager.AppSettings["test"].ToString();
              log.Info(t);
              log.Info("Form Init End");
              log.Debug("debug Form Init End");
              log.Error("error");
              log.Warn("warn");
              log.Fatal("fatal");
                  log.Info("Form Init End"); 
              }
      }
  }
  </code></pre>
  
  <p>The exception occurs at the following line</p>
  
  <pre><code>string t = ConfigurationManager.AppSettings["test"].ToString();
  </code></pre>