title: Can't get Log4Net to work in my ASP.NET website :(
body: <p>really simple question -> i can't seem to get any data from Log4Net in my ASP.NET application. I've got a simple ASP.NET website, which references a class library. In this class library, I have some lines that call the logger.</p>
  
  <p><strong>I'm trying to read the log4net output data in my Visual Studio 2008 debugging <em>Output</em> window</strong>.</p>
  
  <p>Here's my code and my configuration...</p>
  
  <pre><code>//Class Library project
  //File: Foo.cs
  public class FooService
  {
      private static readonly ILog log = LogManager.GetLogger(typeof(FooService));
  
      public FooService()
      {
          // NOTE: To play with my L4N settings, I'll call Debug once, then Info once.
  
          log.Info("Starting Constructor");
  
          // ... snip ...
  
          log.Debug("Leaving Constructor");
      }
  }
  
  
  // ASP.NET Website project
  // File: global.asax
  void Application_Start(object sender, EventArgs eventArgs) 
  {
      log4net.Config.XmlConfigurator.Configure();
  }
  
  // File: Whatever.aspx.cs
  // A delegate method (when a user clicks a button) creates the FooService() instance.
  
  // File: web.config
  &lt;configSections&gt;
      &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler" requirePermission="false" /&gt;
  
      // ....
  
  &lt;/configSections&gt;
  
  
  &lt;log4net&gt;
      &lt;appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender"&gt;
          &lt;mapping&gt;
              &lt;level value="ERROR" /&gt;
              &lt;foreColor value="White" /&gt;
              &lt;backColor value="Red, HighIntensity" /&gt;
          &lt;/mapping&gt;
          &lt;mapping&gt;
              &lt;level value="DEBUG" /&gt;
              &lt;backColor value="Green" /&gt;
          &lt;/mapping&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;appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"&gt;
          &lt;layout type="log4net.Layout.PatternLayout" value="%date [%thread] %-5level %logger - %message%newline" /&gt;
      &lt;/appender&gt;
  
      &lt;appender name="OutputDebugStringAppender" type="log4net.Appender.OutputDebugStringAppender"&gt;
          &lt;mapping&gt;
              &lt;level value="ERROR" /&gt;
              &lt;foreColor value="White" /&gt;
              &lt;backColor value="Red, HighIntensity" /&gt;
          &lt;/mapping&gt;
          &lt;mapping&gt;
              &lt;level value="DEBUG" /&gt;
              &lt;backColor value="Blue" /&gt;
          &lt;/mapping&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;appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"&gt;
          &lt;file value="App_Data\logging\log-append.txt"/&gt;
      &lt;/appender&gt;
  
      &lt;!-- Setup the root category, add the appenders and set the default level --&gt;
      &lt;root&gt;
          &lt;level value="ALL" /&gt;
          &lt;appender-ref ref="OutputDebugStringAppender" /&gt;
          &lt;appender-ref ref="ConsoleAppender" /&gt;
          &lt;appender-ref ref="ColoredConsoleAppender" /&gt;
      &lt;/root&gt;
      &lt;!-- Specify the level for some specific categories --&gt;
      &lt;logger name="DotNetOpenAuth"&gt;
          &lt;level value="ALL" /&gt;
      &lt;/logger&gt;
  &lt;/log4net&gt;
  </code></pre>
  
  <p>Cheers for any help or suggestions...</p>
  
  <p>EDIT: Added the RollingLogFileAppender.</p>