title: Multiple applications in same process using NLog with different targets
body: <p>I have two SharePoint timer jobs that exists in the same process at the same time. The jobs have nothing to do with each other and shoudln't share NLog configuration. However they tend to overlap each other configurations, logging in each others file.</p>
  
  <p>All configuration is done by code. The targets are named and the logger is named. And i make sure to get a reference of the current LogManager.Configuration and reloading it.</p>
  
  <p>Configuration in first timer job:</p>
  
  <pre><code>if (LogManager.Configuration == null)
  {
      LogManager.Configuration = new LoggingConfiguration();
  }
  
  var fileTarget = new FileTarget();
  LogManager.Configuration.AddTarget("file", fileTarget);
  
  fileTarget.Encoding = Encoding.UTF8;
  fileTarget.FileName = "C:/OTDPLog/Log-{0}.txt"._Format(DateTime.Now.ToString("dd-MM-yyyy_hhmmss"));
  fileTarget.Layout = "${date:format=HH\\:mm\\:ss} ${logger} ${event-context:item=Dev} [${level:uppercase=true}]\t${message}.  ${exception:format=ToString,StackTrace}";
  
  var async = new AsyncTargetWrapper(fileTarget, 5000, AsyncTargetWrapperOverflowAction.Block);
  var rule = new LoggingRule("OTDP", LogLevel.Debug, async);
  LogManager.Configuration.LoggingRules.Add(rule);
  
  LogManager.Configuration.Reload();
  </code></pre>
  
  <p>Usage:</p>
  
  <pre><code>var logger = LogManager.GetLogger("OTDP");
  
  logger.Info("bla bla bla");
  </code></pre>
  
  <p>Configuration for the other job:</p>
  
  <pre><code>if (LogManager.Configuration == null)
  {
      LogManager.Configuration = new LoggingConfiguration();
  }
  
  var fileTarget = new FileTarget();
  LogManager.Configuration.AddTarget("file", fileTarget);
  
  fileTarget.Encoding = Encoding.UTF8;
  fileTarget.FileName = "C:/WikiLog/Log-{0}.txt"._Format(DateTime.Now.ToString("dd-MM-yyyy_hhmmss"));
  fileTarget.Layout = "${date:format=HH\\:mm\\:ss} ${logger} ${event-context:item=Dev} [${level:uppercase=true}]\t${message}.  ${exception:format=ToString,StackTrace}";
  
  var async = new AsyncTargetWrapper(fileTarget, 5000, AsyncTargetWrapperOverflowAction.Block);
  var rule = new LoggingRule("Wiki", LogLevel.Debug, async);
  LogManager.Configuration.LoggingRules.Add(rule);
  
  LogManager.Configuration.Reload();
  </code></pre>
  
  <p>Usage:</p>
  
  <pre><code>var logger = LogManager.GetLogger("Wiki");
  logger.Info("bla bla bla");
  </code></pre>
  
  <p>How do i setup loggers for different applications in the same process?</p>