title: Have log4net use application config file for configuration data
body: <p>I would like to store log4net config data in my application.config file. Based on my understanding of the documentation, I did the following:</p>
  
  <ol>
  <li><p>Add a reference to log4net.dll</p></li>
  <li><p>Add the following line in AssemblyInfo.cs:  </p>
  
  <pre><code>[assembly: log4net.Config.XmlConfigurator(Watch = true)]
  </code></pre></li>
  <li><p>Initialize the logger as follows:</p>
  
  <pre><code>private static readonly ILog log = LogManager.GetLogger(typeof(frmWizard));
  </code></pre></li>
  <li><p>I have the following code in my app.config:</p></li>
  </ol>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;configSections&gt;
        &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /&gt;
      &lt;/configSections&gt;
      &lt;log4net&gt;
        &lt;appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" &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;root&gt;
          &lt;level value="INFO" /&gt;
          &lt;appender-ref ref="ConsoleAppender" /&gt;
        &lt;/root&gt;
      &lt;/log4net&gt;
  </code></pre>
  
  <p>However, when I run the application, I get the following error on the console: </p>
  
  <blockquote>
    <p>No appender named [Consoleappender] could be found.</p>
  </blockquote>
  
  <p>How can I get log4net to read settings from the config file?</p>
  
  <p>Thanks!</p>