title: Using NLog with multiple app instances
body: <p>I have a ClickOnce-deployed WinForms app. Users can launch multiple instances of the app. Each instance should write to a separate log file. I need to be able to discover the current instance's log file at runtime, so I can use it for sending out crash reports, etc.</p>
  
  <p>Now I can't get around the multiple instances requirement. (What they really need is a tabbed UI, but this is one big mess of a legacy app, and I just can't implement it right now.)</p>
  
  <p>In general logging works, but separate app instances overwrite the same file.</p>
  
  <p>I have tried to add a time stamp to the log file name, but that didn't work:</p>
  
  <pre><code>&lt;target name="logfile" xsi:type="File" 
                fileName="${specialfolder:folder=ApplicationData}/MyCompany/CRM/crm_${longdate}.log"
                deleteOldFileOnStartup ="true"
                layout="${longdate} ${message} ${exception:format=tostring}"/&gt;
  </code></pre>
  
  <p>Is this possible at all? </p>