title: Log4Net C# logging issue with multi-thread code execution
body: <p>I am using <code>Log4Net</code> to log an exception in my <code>.Net Windows service</code> application.</p>
  
  <p>I want to mention that, my windows service application is running with <code>multi-threading execution</code>, which means that 
  each task is being processed on each different thread and I have used <code>Delegate - (BeginInvoke)</code> pattern.</p>
  
  <p>Importantly, I am using <code>dynamic properties</code> to generate multiple log files dynamically with <code>Log4Net</code>  based on application's different scenarios.</p>
  
  <p>Now, on every <code>logging/ exception</code> scenarios (in C# method), I have used <code>Logger.Log</code> method to log the info/ exception with <code>Log4Net</code>.</p>
  
  <h2>Code (Dynamic file generation)</h2>
  
  <pre><code>GlobalContext.Properties[FileNameParameter] = DirectoryName + fileName;
  LogManager.Info(logMessage);
  </code></pre>
  
  <h2>Config Settings</h2>
  
  <pre><code>&lt;appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"&gt;
        &lt;file type="log4net.Util.PatternString" value="D:\Data\%property{FileName}_info.log"/&gt;
  &lt;/appender&gt;
  </code></pre>
  
  <p>The problem is (I believe), due to multi-threaded code execution, I am getting following things with Log4Net which is weird.</p>
  
  <ol>
  <li>Sometime log file generates, but NO message content.</li>
  <li>Sometime file itself not generating.</li>
  <li>Sometime few file generates, few are NOT generating.</li>
  </ol>
  
  <p>Would you please do let me know why Log4Net behaves like this. I need stable logging with multi-threading code execution.</p>
  
  <p>Thanks in advance!</p>