Suppose I include a Global Nlog config file in my application config file. like so:
=========================================
Global Nlog:
<variable name="logFileName" value="${Logger}"/>
<targets>
<target name="afile" xsi:type="AsyncWrapper" queueLimit="100"
overflowAction="Discard" />
<target name="file" xsi:type="File" layout="${date} ${callsite} ${message}"
fileName="${logFileName}.txt" />
Application.config
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="
http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"> <include file="GlobalNlog.config"/>
<variable name="logFileName" value="NEWFILENAME"/>
</nlog>
=================================
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?
Tim