title: Log4Net does not log from a class library
body: <p>I am working on .NET Framework 4.0 using C# in Windows 7, and trying to log from a class library but it's not working. I'm running my application without errors, but also nothing happens to my log file, neither to my console.</p>
  
  <p>So, here is my code:</p>
  
  <p>This is my <code>App.config</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
  
    &lt;configSections&gt;
      &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /&gt;
    &lt;/configSections&gt;
  
  
    &lt;add key="log4net.config" value="config.log4net"/&gt;
  
    &lt;log4net&gt;
      &lt;appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"&gt;
        &lt;layout type="log4net.Layout.PatternLayout"&gt;
          &lt;conversionPattern value="%date{ABSOLUTE} [%thread] %level %logger - %message%newlineExtra Info: %property{testProperty}%newline%exception"/&gt;
        &lt;/layout&gt;
        &lt;filter type="log4net.Filter.LevelRangeFilter"&gt;
          &lt;levelMin value="DEBUG"/&gt;
          &lt;levelMax value="FATAL"/&gt;
        &lt;/filter&gt;
      &lt;/appender&gt;
      &lt;appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"&gt;
        &lt;file value="MyLogFile.txt"/&gt;
        &lt;appendToFile value="true"/&gt;
        &lt;rollingStyle value="Size"/&gt;
        &lt;maxSizeRollBackups value="5"/&gt;
        &lt;maximumFileSize value="10MB"/&gt;
        &lt;staticLogFileName value="true"/&gt;
        &lt;filter type="log4net.Filter.StringMatchFilter"&gt;
          &lt;stringToMatch value="debug"/&gt;
        &lt;/filter&gt;
        &lt;filter type="log4net.Filter.StringMatchFilter"&gt;
          &lt;stringToMatch value="error"/&gt;
        &lt;/filter&gt;
        &lt;filter type="log4net.Filter.DenyAllFilter"/&gt;
        &lt;layout type="log4net.Layout.PatternLayout"&gt;
          &lt;conversionPattern value="%date [%thread] %level %logger - %message%newline%exception"/&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="RollingFileAppender"/&gt;
      &lt;/root&gt;
      &lt;logger name="MyApplication"&gt;
        &lt;level value="DEBUG"/&gt;
        &lt;appender-ref ref="ConsoleAppender"/&gt;
        &lt;appender-ref ref="RollingFileAppender"/&gt;
      &lt;/logger&gt;
    &lt;/log4net&gt;
  
    &lt;startup&gt;
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt;
    &lt;/startup&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>This is what I put into my <code>AssemblyInfo.cs</code>:</p>
  
  <pre><code>[assembly: log4net.Config.XmlConfigurator(Watch = true)]
  </code></pre>
  
  <p>This what is at the file i'm trying to log:</p>
  
  <pre><code>private static readonly ILog log = LogManager.GetLogger(
  System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  
  
  log.Debug("Testing");
  </code></pre>
  
  <p>When i run my program nothing happens. Someone knows why?</p>