title: How add NLog Class Library project in other projects
body: <p><br/>
  I have created a console project in C# and in that project I am using NLog for logging purpose. <br/>When I run the project, it successfully logging into to multiple targets like Console, File, EventLog and also to Sentinal.<br/>
  But when I make this project as a classLibrary and try to add the reference to another project, it's not logging to any of the targets. And of course there is no error in the project.<br/>
  Following is the code:<br/></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using NLog;
  using NLog.Config;
  
  namespace NLogger
  {
  public class logWrapper
  {
      private static Logger logger = LogManager.GetCurrentClassLogger();
      public void LevelLogger(string level, string msg)
      {
          if (level == "Trace")
              Trace(msg);
          else if (level == "Info")
              Info(msg);
          else if (level == "Error")
              Error(msg);
          else if (level == "Debug")
              Debug(msg);
          else if (level == "Warn")
              Warn(msg);
      }
  
      public void Trace(string msg)
      {
          try
          {
              logger.Trace(msg);
          }
          catch (Exception ex)
          {
              throw;
          }
      }
  
      public void Info(string msg)
      {
          logger.Info(msg);
      }
  
      public void Error(string msg)
      {
          logger.Error(msg);
      }
      public void Debug(string msg)
      {
          logger.Debug(msg);
      }
      public void Warn(string msg)
      {
          logger.Warn(msg);
      }
  
      //Uncomment following when the project type is Console App. --Debugging purpose only
  
      //public static void Main(string[] args)
      //{
      //    logWrapper l = new logWrapper();
      //    l.LevelLogger("Info", "INFORMATION");
      //}
  }
  }
  </code></pre>
  
  <p>Following is Nlog.config file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" &gt;
  &lt;targets&gt;
  &lt;target xsi:type="File" name="file" layout="${longdate}|${level}|${message}|${callsite:fileName=true}${newLine}"
          fileName="C:\Users\sharathk\Desktop\ToCompare\${shortdate}_Log.txt"/&gt;
  &lt;target name="viewer" xsi:type="NLogViewer" address="udp://10.100.18.166:9999"/&gt;
  &lt;target xsi:type="EventLog" name="event" layout="${longdate}|${level}|${message}|${callsite:fileName=true}" source="NLogger"/&gt;
  &lt;target name="console" xsi:type="Console"
          layout="${date:format=HH\:mm\:ss}|${level}|${stacktrace}|${message}" /&gt;
   &lt;/targets&gt;
  
   &lt;rules&gt;
    &lt;!-- add your logging rules here --&gt;
   &lt;logger name="*" minlevel="Trace" writeTo="file,event,viewer,console" /&gt;
   &lt;/rules&gt;
  &lt;/nlog&gt;
  </code></pre>
  
  <p>I am adding this project dll to another project and its not working with no error.<br/></p>
  
  <p>I am creating the object to <strong>logWrapper</strong> class and calling the method to log the information, but it's not working at all.
  Kindly let me know the mistake I am doing here.</p>