title: Log4net not inserting into the database?
body: <p>I have log4net setup and configured to insert into a sql server 2005 table. My table is called Log. When I call the log4net method it does not enter any data into the log database in sql server. I am not getting any errors from my client c# code. Do I need to add a user to the log table in sql? Right now I am using windows authentication.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;configSections&gt;
    &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /&gt;
  &lt;/configSections&gt;
  &lt;log4net&gt;
   &lt;appender name="ADONetAppender" type="log4net.Appender.ADONetAppender"&gt;
     &lt;bufferSize value="100" /&gt;
     &lt;connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt;
  connectionString value="Data Source=V-FIN-SQL-D\SQL2005;Initial Catalog=DevMHAIC;Integrated Security=True;Connection Timeout=360" /&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="32" /&gt;
  &lt;layout type="log4net.Layout.PatternLayout"&gt;
  &lt;conversionPattern value="%t" /&gt;
   &lt;/layout&gt;
   &lt;/parameter&gt;
     &lt;parameter&gt;
      &lt;parameterName value="@log_level" /&gt;
      &lt;dbType value="String" /&gt;
      &lt;size value="512" /&gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
        &lt;conversionPattern value="%p" /&gt;
      &lt;/layout&gt;
    &lt;/parameter&gt;
     &lt;parameter&gt;
      &lt;parameterName value="@logger" /&gt;
      &lt;dbType value="String" /&gt;
      &lt;size value="512" /&gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
        &lt;conversionPattern value="%c" /&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="%m" /&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>Here is my sql code for the log database:</p>
  
  <pre><code>CREATE TABLE [dbo].[Log](
  [Id] [int] IDENTITY(1,1) NOT NULL,
  [Date] [datetime] NULL,
  [Thread] [varchar](255) NULL,
  [Level] [varchar](50) NULL,
  [Logger] [varchar](255) NULL,
  [Message] [varchar](4000) NULL,
  [Exception] [varchar](2000) NULL
  ) ON [PRIMARY] 
  </code></pre>
  
  <p>Here is my class that I am using to call the log4net.</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class ErrorLog : ILog
  {
      log4net.ILog _Log;
  
      /// &lt;summary&gt;
      /// Initializes a new instance of the &lt;see cref="ErrorLog"/&gt; class.
      /// &lt;/summary&gt;
      /// &lt;param name="log"&gt;The log.&lt;/param&gt;
      public ErrorLog(log4net.ILog log) : this()
      {
          _Log = log;
      }
  
      /// &lt;summary&gt;
      /// Initializes a new instance of the &lt;see cref="ErrorLog"/&gt; class.
      /// &lt;/summary&gt;
      public ErrorLog()
      {
          _Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  
          log4net.Config.XmlConfigurator.Configure(); 
      }
  
      /// &lt;summary&gt;
      /// Informationals the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      public void informational(string message)
      {
          _Log.Info(message);
      }
  
      /// &lt;summary&gt;
      /// Informationals the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      /// &lt;param name="innerException"&gt;The innerException.&lt;/param&gt;
      public void informational(string message, Exception innerException)
      {
          _Log.Info(message, innerException);
      }
  
      /// &lt;summary&gt;
      /// Debugs the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      public void debug(string message)
      {
          _Log.Debug(message);
      }
  
      /// &lt;summary&gt;
      /// Debugs the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      /// &lt;param name="innerException"&gt;The innerException.&lt;/param&gt;
      public void debug(string message, Exception innerException)
      {
          _Log.Debug(message, innerException);
      }
  
      /// &lt;summary&gt;
      /// Errors the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      public void error(string message)
      {
          _Log.Error(message);
      }
  
      /// &lt;summary&gt;
      /// Errors the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      /// &lt;param name="innerException"&gt;The innerException.&lt;/param&gt;
      public void error(string message, Exception innerException)
      {
          _Log.Error(message, innerException);
      }
  
      /// &lt;summary&gt;
      /// Warnings the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      public void warning(string message)
      {
          _Log.Warn(message);
      }
  
      /// &lt;summary&gt;
      /// Warnings the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      /// &lt;param name="innerException"&gt;The innerException.&lt;/param&gt;
      public void warning(string message, Exception innerException)
      {
          _Log.Warn(message, innerException);
      }
  }
  </code></pre>
  
  <p>Here is my interface:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public interface ILog
  {
      /// &lt;summary&gt;
      /// Informationals the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      void informational(string message);
  
      /// &lt;summary&gt;
      /// Informationals the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      /// &lt;param name="innerException"&gt;The innerException.&lt;/param&gt;
      void informational(string message, Exception innerException);
  
      /// &lt;summary&gt;
      /// Debugs the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      void debug(string message);
  
      /// &lt;summary&gt;
      /// Debugs the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      /// &lt;param name="innerException"&gt;The innerException.&lt;/param&gt;
      void debug(string message, Exception innerException);
  
      /// &lt;summary&gt;
      /// Errors the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      void error(string message);
  
      /// &lt;summary&gt;
      /// Errors the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      /// &lt;param name="innerException"&gt;The innerException.&lt;/param&gt;
      void error(string message, Exception innerException);
  
      /// &lt;summary&gt;
      /// Warnings the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      void warning(string message);
  
      /// &lt;summary&gt;
      /// Warnings the specified message.
      /// &lt;/summary&gt;
      /// &lt;param name="message"&gt;The message.&lt;/param&gt;
      /// &lt;param name="innerException"&gt;The innerException.&lt;/param&gt;
      void warning(string message, Exception innerException);
  }
  </code></pre>