title: Nlog does not write to log file in windows service
body: <p>I have a windows service written in .net 4.0 and I installed it under credential of Local System. In the code I used nlog,</p>
  
  <pre><code>private static Logger logger = LogManager.GetCurrentClassLogger();
  logger.Debug("some information");
  </code></pre>
  
  <p>I also have nlog.config copied to the same directory where exe file resides</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 name="logfile" type="File"
              fileName="c:\log\TestService\My.log"
              layout="${longdate}::${logger}::${message}"
              keepFileOpen="false" /&gt;
    &lt;/targets&gt;
  
    &lt;rules&gt;
      &lt;logger name="*" minlevel="Info" maxLevel="Deubg" writeTo="logfile" /&gt;
    &lt;/rules&gt;
  &lt;/nlog&gt;
  </code></pre>
  
  <p>But if I start the service, I don't see the log file has been created at all. If I swap the <code>log.Debug</code> code to <code>Debug.WriteLine</code> and use my Visual Studio to attach to the windows service process to debug, I can see the output window has my debugging message, which means my windows service code is correct.</p>
  
  <p>Is there any problem with my nlog code?</p>
  
  <p>-- <strong>Update 1</strong> --</p>
  
  <p>I updated nlog.config to </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 name="logfile" type="File"
              fileName="c:\log\TestService\My.log"
              layout="${longdate}::${logger}::${message}"
              keepFileOpen="false" /&gt;
    &lt;/targets&gt;
  
    &lt;rules&gt;
      &lt;logger name="*" minlevel="Trace" writeTo="logfile" /&gt;
    &lt;/rules&gt;
  &lt;/nlog&gt;
  </code></pre>
  
  <p>and changed my code to </p>
  
  <pre><code>logger.Trace("some information");
  </code></pre>
  
  <p>then it works. I am not sure what is wrong with my first set of configuration.</p>