我一直在使用log4net,并且已经插入了额外的字段,但是我在添加int字段时遇到了问题.任何人都可以显示使用int的配置,因为我无法在他们的主页上找到它.
我通常只使用如下配置:
<parameter>
<parameterName value="@orderid" />
<dbType value="string" />
<size value="64" />
<layout type="log4net.Layout.PatternLayout" />
</parameter>
Run Code Online (Sandbox Code Playgroud)
但是,如果此字段可能是int,则在日志数据库中进行搜索会更加优化.
小智 23
只是将其更改为Int32并没有解决我的问题.对于其他希望解决此问题的人来说,这是解决方案:
<parameter>
<parameterName value="@UserID" />
<dbType value="Int32" />
<size value="32" />
<layout type="log4net.Layout.RawPropertyLayout">
<key value="UserID" />
</layout>
</parameter>
Run Code Online (Sandbox Code Playgroud)
这也将处理NULL
| 归档时间: |
|
| 查看次数: |
3723 次 |
| 最近记录: |