title: How to change the NLog layout at run time?
body: <p>I created the NLog.config:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        throwExceptions="false"
        throwConfigExceptions="true"&gt; &lt;!--make NLog complain, when something is wrong with the configuration--&gt;
  
  
    &lt;targets&gt;
      &lt;target name="logfile" xsi:type="File" 
              fileName="${basedir}/Logs/Log_${shortdate}.txt" 
              layout="[${longdate}] [${uppercase:${level}}] ${message} ${exception:format=tostring}"
              /&gt;
      &lt;target name="logconsole" xsi:type="ColoredConsole" 
              layout="[${longdate}] ${uppercase:${level}}: ${message} ${exception:format=tostring}"
              /&gt;    
    &lt;/targets&gt;
  
    &lt;rules&gt;
      &lt;logger name="*" minlevel="Info" writeTo="logconsole" /&gt;
      &lt;logger name="*" minlevel="Debug" writeTo="logfile" /&gt;
  
    &lt;/rules&gt;
  &lt;/nlog&gt;
  </code></pre>
  
  <p>When I call <code>logger.Info("Hello World");</code> I get an output both in the console and the file:</p>
  
  <pre><code>[2018-03-17 15:34:24.2843] INFO: Hello World
  </code></pre>
  
  <p>Which is fine.
  Now in <strong>some cases</strong> I do not want to display the date-time part, and I want to display it only in the console.</p>
  
  <p>How would I do that with NLog?</p>
  
  <p>A <strong>pseudo</strong> solution I would want is: </p>
  
  <pre><code>logger.Info("Hello World", writeTo: "logconsole", layout: "[${uppercase:${level}}] ${message}");
  </code></pre>
  
  <p>I tried adding a new <code>taget</code></p>
  
  <pre><code>&lt;target name="logconsole_simple" xsi:type="ColoredConsole"
              layout="${uppercase:${level}}: ${message} ${exception:format=tostring}"/&gt;
  </code></pre>
  
  <p>and new rule:</p>
  
  <pre><code>&lt;logger name="logconsole_simple"  level="Info" writeTo="logconsole_simple" /&gt;
  </code></pre>
  
  <p>And call it like: </p>
  
  <pre><code>logger.Log(LogEventInfo.Create(LogLevel.Info, "logconsole_simple", "simple message!"));
  </code></pre>
  
  <p>But it still displays the date-time part and logs it to the file also (which I don't want). 
  How to fix this?</p>