Log4net and ints

I worked a bit with log4net and added extra fields, but I have problems adding int fields. Can anyone show the configuration where int is used since I could not find it on my home page .

I usually use a configuration such as:

 <parameter>
        <parameterName value="@orderid" />
        <dbType value="string" />
        <size value="64" />
        <layout type="log4net.Layout.PatternLayout" />
    </parameter>

But it would be more optimal to search the log database if this field could be instead of int.

+5
source share
2 answers

The dbType property is of type System.Data.DbType . There you can use the Int32 value to represent integers.

+4
source

Int32 . , , :

        <parameter>
            <parameterName value="@UserID" />
            <dbType value="Int32" />
            <size value="32" />
            <layout type="log4net.Layout.RawPropertyLayout">
                <key value="UserID" />
            </layout>
        </parameter>

NULL

+16

All Articles