title: Setting up Log4Net to log output from a Class Library
body: <p>I'm trying to setup Log4Net (this is my first time using Log4Net) to log to a text file in an assembly. I'm not getting any errors, but it's also not working. I can breakpoint the lines where I am logging my output and see that they are reached, but like I say nothing happens.</p>
  
  <p>Where am I going wrong?</p>
  
  <p>I have added the following to my <code>packages.config</code> file, inside the <code>&lt;packages&gt;</code> attribute:</p>
  
  <pre class="lang-xml prettyprint-override"><code>  &lt;log4net&gt;
      &lt;appender name="FileAppender" type="log4net.Appender.FileAppender,log4net"&gt;
        &lt;file value="c:\CTI\log.txt" /&gt;
        &lt;appendToFile value="true" /&gt;
        &lt;lockingModel type="log4net.Appender.FileAppender+MinimalLock" /&gt;
        &lt;layout type="log4net.Layout.PatternLayout"&gt;
          &lt;conversionPattern value="%date [%thread] %level %logger - %message%newline" /&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;root&gt;
        &lt;level value="DEBUG"/&gt;
        &lt;appender-ref ref="FileAppender"/&gt;
      &lt;/root&gt;
    &lt;/log4net&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I have added the following line to <code>AssemblyInfo.cs</code>:</p>
  
  <pre><code>[assembly: log4net.Config.XmlConfigurator(Watch=true)]
  </code></pre>
  
  <p>I added the Log4Net assembly using NuGet and I am logging like this:</p>
  
  <pre><code>private log4net.ILog _Log;
  _Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  _Log.Debug("FooBar");
  </code></pre>
  
  <p>Like I say, no errors but nothing happens either.</p>
  
  <p>What am I missing?</p>