我正在使用 ADONetAppender 来(尝试)通过存储过程记录数据(以便我可以将逻辑注入到日志记录例程中)。
我的配置设置如下所示。谁能告诉我做错了什么?
<appender name="ADONetAppender_SqlServer" type="log4net.Appender.ADONetAppender">
<bufferSize value="1" />
<threshold value="ALL"/>
<param name="ConnectionType" value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<param name="ConnectionString" value="<MyConnectionString>" />
<param name="UseTransactions" value="False" />
<commandText value="dbo.LogDetail_via_Log4Net" />
<commandType value="StoredProcedure" />
<parameter>
<parameterName value="@AppLogID"/>
<dbType value="String"/>
<size value="50" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{LoggingSessionId}" />
</layout>
</parameter>
<parameter>
<parameterName value="@CreateUser"/>
<dbType value="String"/>
<size value="50" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{HttpUser}" />
</layout>
</parameter>
<parameter>
<parameterName value="@Message"/>
<dbType value="String"/>
<size value="8000" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message" />
</layout>
</parameter>
<parameter>
<parameterName value="@LogLevel"/>
<dbType value="String"/>
<size value="50"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%level" />
</layout>
</parameter>
</appender>