Log4Net ADO logging

Topics: General, Troubleshooting
Jun 3, 2014 at 6:41 AM
I am trying to get Log4Net in Orchard 1.8 to log to log4net.Appender.AdoNetAppender. I have created the SQLServer table and configured the appender:

<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
<bufferSize value="1" />
<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<connectionString value="Data Source=machine_name\SQLEXPRESS;Initial Catalog=Orchard;integrated security=false;Persist Security Info=True;User ID=orcharduser;Password=password" />
<commandText value="INSERT INTO Orchard_Logs ([Date],[Level],[Logger],
[Message],[Exception]) VALUES (@log_date, @log_level, @logger, @message, @exception)" />
<parameter>
  <parameterName value="@log_date" />
  <dbType value="DateTime" />
  <layout type="log4net.Layout.RawTimeStampLayout" />
</parameter>
<parameter>
  <parameterName value="@log_level" />
  <dbType value="String" />
  <size value="50" />
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%level" />
  </layout>
</parameter>
<parameter>
  <parameterName value="@logger" />
  <dbType value="String" />
  <size value="255" />
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%logger" />
  </layout>
</parameter>
<parameter>
  <parameterName value="@message" />
  <dbType value="String" />
  <size value="4000" />
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%message" />
  </layout>
</parameter>
<parameter>
  <parameterName value="@exception" />
  <dbType value="String" />
  <size value="2000" />
  <layout type="log4net.Layout.ExceptionLayout" />
</parameter>
</appender>

<root>
<!-- Value of priority may be ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF. -->
<priority value="WARN" />
<appender-ref ref="error-file" />
<appender-ref ref="debug-file" />
<appender-ref ref="AdoNetAppender" />
</root>

<logger name="Orchard.Users.Services.MembershipService">
<priority value="ALL" />
<appender-ref ref="AdoNetAppender" />
</logger>

and nothing gets logged. Any suggestions please?