title: .Net logger that support hierarchy and thread safety
body: <p>I have two dlls. both are using log4Net and log.</p>
  
  <p>The first Dll 'A.dll' has an async function that log parallel and has a unique id for each call.
  This function is using the second dll 'B.dll' which log too.</p>
  
  <pre><code>logger.Log("Is about to enter B function");
  B.somefucntion();
  </code></pre>
  
  <p>The problem is that I have multiple logs from 'A.dll' and 'B.dll' and I can't connect between them.</p>
  
  <p>I can't send the unique id of the function to 'B.dll' (this is an extenral dll that I can't modify).</p>
  
  <p>I though of a solution in which in 'A.dll' opens a scope, and every log in between this scope will be added under this scope + it's message.</p>
  
  <pre><code>logger.Log("Is about to enter B function");
  using (logger.Scope("Bla bla " + id))
  {
     B.somefucntion();
  }
  </code></pre>
  
  <p>Then each log occur in 'B.dll' will start with "Bla bla + {id}".
  I already implemented it and it's working.</p>
  
  <p>The problem with this solution is that it's not thread safe, so multiple threads can change the current scope together. Thus the scope as no meaning.</p>
  
  <p>Do you know another solution, that is already implemented/ I need to implement?</p>
  
  <p>Thank you very much.</p>