Is it possible to change writeTo value at runtime?
NLog version: 4.6.0-rc1
Platform: .Net 4.5
Current NLog config (xml or C#, if relevant)
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="console" xsi:type="Console"
layout="${date:format=HH\:mm\:ss}|${level}|${stacktrace}|${message}"/>
<target name="file" xsi:type="File" fileName="${shortdate}-${windows-identity:domain=false}.txt"
layout="${date:format=HH\:mm\:ss} - ${message}"/>
</targets>
<rules>
<logger name="*" minlevel="Error" writeTo="file" />
</rules>
</nlog>
yes, in C# / .NET
e.g.
```c#
var myNewTarget = new FileTarget();
var config = LogManager.Configuration;
config.LoggingRules[0].Targets.Clear();
config.LoggingRules[0].Targets.Add(myNewTarget);
//apply
LogManager.Configuration = config;
```
see also https://github.com/NLog/NLog/wiki/Configuration-API
Most helpful comment
yes, in C# / .NET
e.g.
```c#
var myNewTarget = new FileTarget();
var config = LogManager.Configuration;
config.LoggingRules[0].Targets.Clear();
config.LoggingRules[0].Targets.Add(myNewTarget);
//apply
LogManager.Configuration = config;
```
see also https://github.com/NLog/NLog/wiki/Configuration-API