title: Logging multiple threads with nlog
body: <p>I use nlog logger in my project.</p>
  
  <p>My program generates xml files based on data which i getting from sql server. I'm doing this with PLINQ. But also i have to log tracing info to be able make some investigations on exceptional cases on prod environment.</p>
  
  <p>Result logs looks awful, when it came from multiple threads. For example:</p>
  
  <pre><code>Operation 1 started
  Deserializing XXX
  Operation 2 started
  Deserializing XXX finished with status X
  Filling XXX with data from Z
  Deserializing YYY....
  </code></pre>
  
  <p>And its just for degree of parallelism 2.</p>
  
  <p>I'd like to see result like this:</p>
  
  <pre><code>Operation 1 started
  Deserializing XXX
  Deserializing XXX finished with status X
  Filling XXX with data from Z
  Operation 1 finished
  Operation 2 started    
  Deserializing YYY....
  </code></pre>
  
  <p>I see some solutions, but they're not looking good enough:</p>
  
  <ol>
  <li><p>Save logging data to some buffer and flush it when parallel task ends - I will be ought to pass context to all inner methods (looks terrible!). </p></li>
  <li><p>Add some kind of prefix to logging message to help getting context for some messages - i have to pass prefix to every inner message (also looks terrible).</p></li>
  </ol>
  
  <p>Is there some clean solutions for this problem?</p>