title: How to print threadid instead of threadname by using NLog when .Net Thread does not have name?
body: <p>I have NLog configuration like below.</p>
  
  <p>It prints name of thread if it exists. Otherwise I get empty string instead of thread name.</p>
  
  <p><strong>Question:</strong> how can I archive behavior below?</p>
  
  <ul>
  <li>If thread has name - print name of thread</li>
  <li>Otherwise - print ManagedThreadId (e.g. the same with <code>threadid</code> NLog variable).</li>
  </ul>
  
  <p>Current configuration example:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;variable name="defaultLayout" value="${date} ${level} [${threadname}] ${logger} - ${message} ${exception:format=ToString}"/&gt;
  
  &lt;targets async="true"&gt;
    &lt;target name="ConsoleAppender" 
            type="ColoredConsole" 
            layout="${var:defaultLayout}" /&gt;
  &lt;/targets&gt;
  </code></pre>
  
  <p>Please note: I'd like to avoid printing both variables, e.g. this layout of not useful: <code>... [${threadname}-${threadid}] ...</code></p>