How use NLog write message to Devart dotConnect for Oracle

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How use NLog write message to Devart dotConnect for Oracle

tony
<targets>
    <target name="app" xsi:type="File" fileName="${basedir}/MyFile.log" deleteOldFileOnStartup="true"
            layout="${date:format=HH\:mm\:ss}|${threadname}|${level}|${logger}|${message}"/>
    <target name="database" xsi:type="Database"
        dbProvider="Devart.Data.Oracle.OracleConnection, Devart.Data.Oracle, Version=6.10.135.0, Culture=neutral, PublicKeyToken=09af7300eec23701"
        connectionstring="MyConnectionString">
      <commandText>
        insert into WORK_LOG([CREATEDATE], [ORIGIN], [LOGLEVEL], [MESSAGE], [EXCEPTION], [STAKETRACE]) values (:createDate, :origin, :logLevel, :message, :exception, :stackTrace);
      </commandText>
      <parameter name="createDate" layout="${date:format=yyyy-MM-dd HH\:mm\:ss}" />
      <parameter name="origin" layout="${callsite}"/>
      <parameter name="logLevel" layout="${level}"/>
      <parameter name="message" layout="${message}"/>
      <parameter name="exception" layout="${exception:format=Message,StackTrace}"/>
      <parameter name="stackTrace" layout="${stacktrace}"/>
    </target>
</targets>
<rules>
    <logger name="*" minlevel="Trace" writeTo="database" />
    <logger name="*" minlevel="Trace" writeTo="app" />
</rules>

When I call the Trace Method,the message in the MyFile.log but not in the database table WORK_LOG.
Can I use NLog write message to Devart dotConnect for Oracle?
Thans!