Entering an XML column using log4net

Is it possible to connect to an XML column in SQL Server using AdoNetAppender in log4net?

I know that I can process the column as a string and write this path through:

<parameter>
    <parameterName value="@details" />
    <dbType value="String" />
    <size value="4000" />
    <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%property{Details}" />
    </layout>
</parameter>

But I would prefer to use:

<parameter>
    <parameterName value="@details" />
    <dbType value="Xml" />
    <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%property{Details}" />
    </layout>
</parameter>

Unfortunately this does not work.

I would rather record using the actual database type instead of using the fact that I could just use a string.

+3
source share
1 answer

DbType.Xml .Net 2.0. DBType.Xml ADO.NET , XML .

+2

Source: https://habr.com/ru/post/1707875/


All Articles