title: Log4Net File Appender Not Logging
body: <p>my FileAppender isn't working. It probably isn't a permissions thing as I'm local admin. </p>
  
  <p>I've enabled internal debugging and I'm not getting any errors or exceptions from log4net.</p>
  
  <p>My config file is below.
  Thanks</p>
  
  <pre><code>&lt;log4net&gt;
          &lt;appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" &gt;
              &lt;layout type="log4net.Layout.PatternLayout"&gt;
                  &lt;conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" /&gt;
              &lt;/layout&gt;
          &lt;/appender&gt;
          &lt;appender name="FileAppender" type="log4net.Appender.FileAppender"&gt;
              &lt;file value="C:\log-file.txt" /&gt;
              &lt;appendToFile value="true" /&gt;
              &lt;layout type="log4net.Layout.PatternLayout"&gt;
                  &lt;conversionPattern value="%date [%thread] %-5level %logger [%ndc] - %message%newline" /&gt;
              &lt;/layout&gt;
          &lt;/appender&gt;
          &lt;root&gt;
              &lt;level value="DEBUG" /&gt;
              &lt;appender-ref ref="ConsoleAppender" /&gt;
              &lt;appender-ref ref="FileAppender" /&gt;
          &lt;/root&gt;
      &lt;/log4net&gt;
  </code></pre>
  
  <p>The code to log is effectively:-</p>
  
  <pre><code>public class Logger
  {
      private static readonly ILog defaultLog;
      static Logger()
      {
          BasicConfigurator.Configure();
          defaultLog = LogManager.GetLogger("default");
      }
  
      public static void Log(string errorMessage, Exception exception)
      {
          defaultLog.Error(errorMessage, exception);
      }
  }
  </code></pre>