title: Log4Net AdoNetAppender - Formatting log date to get seconds included
body: <p>My issue is that my Database logging does not display seconds (default format seems to be "yyyy-MM-dd hh:mm:00".
  Is there any way to change this and get something with seconds at least (miliseconds would be a plus)?</p>
  
  <p>Here is my appender config:</p>
  
  <pre><code>&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="data source=MyDB;initial catalog=LogSpace;integrated security=True;persist security info=True;Application Name=&amp;quot;MyApp &amp;quot;" /&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;
  </code></pre>
  
  <p>Thank you for your help!</p>
  
  <p><strong>EDIT</strong>: Just as suggested by leppie, I checked my Date type in database, which was smalldatetime. I changed it to datetime and now my logs are as expected (with seconds &amp; milliseconds)</p>