NLog and Managed Oracle

672 views
Skip to first unread message

Michael Ostermann

unread,
Jan 8, 2015, 9:36:17 AM1/8/15
to nlog-...@googlegroups.com
Hi,

is there a possibility to use the Oracle.ManagedDataAccess.Client as dbProvider? 
I can't find any documentation on this and the application is being upgraded to the managed driver to get rid of the local oracle installations.

Any help would be appreciated.
Michael

Michael Ostermann

unread,
Jan 9, 2015, 9:25:00 AM1/9/15
to nlog-...@googlegroups.com
After inspecting the Nlog code I found out how to find which dbproviderlist NLog is matching against and I adjusted my config target as follows.

dbProvider="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342"

The Nlog process runs through without any problems, but the database does not show any changes. 
Is there any additional NLog debugging I could enable to see what happens when the DB target is used?

M

Anton Forbes

unread,
Jul 7, 2016, 8:10:03 AM7/7/16
to NLog-Users

I know this is old but this worked for me (connectionstring redacted). It seems the first argument to provider should be IDbConnection. 


<target name="database" xsi:type="Database" keepConnection="false" useTransactions="true"
                dbProvider="Oracle.ManagedDataAccess.Client.OracleConnection, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"
                connectionString="user id=user;password=pass;data source=src"
                commandText="insert into gtlTransferLog(LOGCREATED, LOGLEVEL,LogDetail) values(sysdate, :LOGLEVEL,:MESSAGE)">
            <!--<parameter name="TIME_STAMP" layout="${longdate}" /> -->
            <parameter name="LOGLEVEL" layout="${level:uppercase=true}" />
            <parameter name="MESSAGE" layout="${message}" />
        </target>

Also, I found it easier to debug this stuff by setting nlog's throwExceptions to "true" so I can see internal error messsages
Reply all
Reply to author
Forward
0 new messages