Say I defined the NLog target as:
<variable name="day" value="${date:format=dddd}"/>
<targets>
<target name="file" xsi:type="File" layout="${verbose}" fileName="${basedir}/${day}.log" />
</targets>
However I really want to place the file location at an app config file or other xml file. I don't know how to set up the unc path in the C# code programmatically rather than in NLog configuration file.
Edit:
Say the application will be distributed in 100 clients in different location in US. Each client would prefer its own log file location. The application has its own app.config or respective xml file to store its location. So it seems no way to hard code the locations in NLog configuration file.
{basedir}was referred to the application folder(github.com/nlog/NLog/wiki/File-target). But in my case the clients would customize their own. For ex, client 1 would select "\\1111\log.txt", but client 2 would like "\\2222\log.txt". The information are save the xml file or app config. Yes, I want programmatically to set them. - user1108948