title: Nlog: How to output Nested Diagnostics Context value to a log file?
body: <p>I can't find an example on how do I modify my config file so that I can output the string passed to Nested Diagnostics Context.</p>
  
  <p>Here is the C# code:</p>
  
  <pre><code>using (NLog.NestedDiagnosticsContext.Push(DateTime.Now.Ticks.ToString()))
  {
  //some logging
  }
  </code></pre>
  
  <p>and this is the nLog entry in web.config (not sure how to modify this):</p>
  
  <pre><code>&lt;nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  
      &lt;!-- make sure to set 'Copy To Output Directory' option for this file --&gt;
      &lt;targets&gt;
        &lt;target name="logfile" xsi:type="File" fileName="somepath\\logfile.txt" /&gt;
      &lt;/targets&gt;
  
      &lt;rules&gt;
        &lt;logger name="*" minlevel="Debug" writeTo="logfile" /&gt;
      &lt;/rules&gt;
    &lt;/nlog&gt;
  </code></pre>