Is there a way to "redefine" the variable logFileName so that the Application Nlog config file can route the logs to a different filename if they do not want to use what is defined in the Global config file?
Hey man, it sounds like you need to know about pulling the files in to objects. Here's a snippet that should kick you in the right direction:
var config = LogManager.Configuration;
var dbTarget = (DatabaseTarget)config.FindTargetByName("log");
dbTarget.CommandText = string.Format("new update command");
So basically, you can ask the LogManager (using NLog statement needed) to pull the xml layout objects into c# objects. Modify them as shown, my program used a dynamic insert statement for the database as opposed to different log file locations, and then after everything is set do the last call. You can then get the object again and see the changes are in fact made, though not represented in the xml file. The changes will revert to the original xml file when the program is finished.