NLog and Managed Oracle

Skip to first unread message

Michael Ostermann

Jan 8, 2015, 9:36:17 AM1/8/15

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 Ostermann

Jan 9, 2015, 9:25:00 AM1/9/15
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=, 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?


Anton Forbes

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=, 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}" />

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
0 new messages