title: log4net AdoNetAppender not logging into sql azure db in web application
body: <p>I have been attempting to get log4net logging any info or error into my SQL Azure db in my asp.net web application with no success or any noticable errors. I am attempting to use the ADONetAppender appender with the following web.config:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="log4net"
           type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"
           /&gt;
    &lt;/configSections&gt;
    &lt;log4net&gt;
      &lt;appSettings&gt;
        &lt;add key="log4net.Internal.Debug" value="true"/&gt;
      &lt;/appSettings&gt;
      &lt;appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender"&gt;
        &lt;bufferSize value="1" /&gt;
        &lt;connectionType value="System.Data.SqlClient.SqlConnection, System.Data,
   Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt;
        &lt;connectionString value="Server=;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True" /&gt;
        &lt;commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message],[Exception]) 
   VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)" /&gt;
  
        &lt;parameter&gt;
          &lt;parameterName value="@log_date" /&gt;
          &lt;dbType value="DateTime" /&gt;
          &lt;layout type="log4net.Layout.RawTimeStampLayout" /&gt;
        &lt;/parameter&gt;
        &lt;parameter&gt;
          &lt;parameterName value="@thread" /&gt;
          &lt;dbType value="String" /&gt;
          &lt;size value="255" /&gt;
          &lt;layout type="log4net.Layout.PatternLayout"&gt;
            &lt;conversionPattern value="%thread" /&gt;
          &lt;/layout&gt;
        &lt;/parameter&gt;
        &lt;parameter&gt;
          &lt;parameterName value="@log_level" /&gt;
          &lt;dbType value="String" /&gt;
          &lt;size value="50" /&gt;
          &lt;layout type="log4net.Layout.PatternLayout"&gt;
            &lt;conversionPattern value="%level" /&gt;
          &lt;/layout&gt;
        &lt;/parameter&gt;
        &lt;parameter&gt;
          &lt;parameterName value="@logger" /&gt;
          &lt;dbType value="String" /&gt;
          &lt;size value="255" /&gt;
          &lt;layout type="log4net.Layout.PatternLayout"&gt;
            &lt;conversionPattern value="%logger" /&gt;
          &lt;/layout&gt;
        &lt;/parameter&gt;
        &lt;parameter&gt;
          &lt;parameterName value="@message" /&gt;
          &lt;dbType value="String" /&gt;
          &lt;size value="4000" /&gt;
          &lt;layout type="log4net.Layout.PatternLayout"&gt;
            &lt;conversionPattern value="%message" /&gt;
          &lt;/layout&gt;
        &lt;/parameter&gt;
        &lt;parameter&gt;
          &lt;parameterName value="@exception" /&gt;
          &lt;dbType value="String" /&gt;
          &lt;size value="2000" /&gt;
          &lt;layout type="log4net.Layout.ExceptionLayout" /&gt;
        &lt;/parameter&gt;
      &lt;/appender&gt;
      &lt;root&gt;
        &lt;level value="DEBUG" /&gt;
        &lt;appender-ref ref="ADONetAppender" /&gt;
      &lt;/root&gt;
    &lt;/log4net&gt;
  </code></pre>
  
  <p>....
  </p>
  
  <p>In my global.asax Application_Start I call</p>
  
  <pre><code> void Application_Start(object sender, EventArgs e)
              {
                  // Code that runs on application startup
                  log4net.Config.XmlConfigurator.Configure();
  
  
              }
  </code></pre>
  
  <p>Then to attempt to log:</p>
  
  <pre><code> readonly ILog _logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  
   protected void Button1_Click(object sender, EventArgs e)
      {
          if (_logger.IsInfoEnabled)
              _logger.Info("Performance sensitive Info message");
          _logger.Info("testing web role into Poqlogging");
          _logger.Error("new error",new Exception("new exception"));
      }
  </code></pre>
  
  <p>All of this does nothing as far as I can tell.</p>