Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

How to add connection string "credentials" dynamically from template in NLOG

$
0
0

I'm trying to pull up database connection string credentials from template config file for my Nlog connection string, I tried doing it somehow it's not working, any suggestions would appreciate

<target name="database" connectionString=":ConnectionStringSTR" xsi:type="Database" keepConnection="false" useTransactions="true" commandType="Text" dbProvider="Oracle.DataAccess.Client"      commandText="insert into LOG (LogName,LogDetails) values (:LogName,:LogDetails)"><parameter name="LogName" layout="${event-context:item=LogName}" /><parameter name="LogDetails" layout="${event-context:item=LogDetails}" /></target>

Below under resource tag I created a credential variable which will generate connection string with respective username and password

<Properties><Property Name="ConnectionStringSTR" Value="Data Source=ABCD100;User Id=NLOGUSER;Password=NLOG12345;Persist Security Info=false"/><Property Name="ConnectionTimeout" Value="15"/></Properties>

This is not working as records are not getting inserted in DB.How to configure this values - connectionString=":ConnectionStringSTR"


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>