title: log4net and nunit tests, most basic example
body: <p>I want to try log some app messages from my app. In this very situation I just want to force nunit to work with log4net. I found some example here <a href="http://www.ofconsulting.com/PublicPortal/ofc-tech-blog/92-configure-log4net-with-nunit.html" rel="noreferrer">http://www.ofconsulting.com/PublicPortal/ofc-tech-blog/92-configure-log4net-with-nunit.html</a>.</p>
  
  <p>log4net is confugured in app.config like this:</p>
  
  <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;root&gt;
        &lt;level value="DEBUG" /&gt;
        &lt;appender-ref ref="LogFileAppender" /&gt;
      &lt;/root&gt;
      &lt;appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender" &gt;
        &lt;param name="File" value="log.txt" /&gt;
        &lt;param name="AppendToFile" value="true" /&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;param name="ConversionPattern" value="%-5p%d{yyyy-MM-dd hh:mm:ss} – %m%n" /&gt;
        &lt;/layout&gt;
      &lt;/appender&gt;
    &lt;/log4net&gt;
  </code></pre>
  
  <p><strong>And in my test code is following</strong></p>
  
  <pre><code>[TestFixture]
  class DomainTests
  {
      protected static readonly ILog log = LogManager.GetLogger(typeof(DomainTests));
      public void LoggingTests()
      {            
          log4net.Config.XmlConfigurator.Configure(); 
      }
  
      [Test]
      public void BasicLogTest()
      {
          log.Error("write my log entry already");
      }
  </code></pre>
  
  <p>My test is passed but nothing is written inside log.txt file. What am I doing wrong?<br>
  I just want to make it as simple as possible to store messages like entering an application, exit application. Regards.</p>