title: NLOG do not logs unhandled exceptions on server
body: <p>I am experiencing following behavior:</p>
  
  <ol>
  <li><p>In development (local) there is no problem logging exceptions, all kind works.</p></li>
  <li><p>When I logged in remote server ( by remote desktop connection ) and open a chrome inside the server and create the exception,  there is also no problem, all kind of logging works.</p></li>
  <li><p>If I use my laptop and Chrome Browser to  open the same website that is hosted on the server:</p></li>
  </ol>
  
  <p>Controller/Action</p>
  
  <pre><code>{
     // log record gets created for the following line
     logger.Log(LogLevel.Fatal, "Sample informational message"); 
  
     // log record not created. However this record get created in item 1 and 2 case above
     int a = int.Parse("A");  
  }
  </code></pre>
  
  <p>Global.asax</p>
  
  <pre><code> protected void Application_Error(object sender, EventArgs e)
   {
          Logger logger = LogManager.GetCurrentClassLogger();
          logger.Fatal(Server.GetLastError());
          Server.ClearError();
   }
  </code></pre>
  
  <p>NLog.config</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"
    xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
    autoReload="true"
    throwExceptions="false"
    internalLogLevel="Off"
    internalLogFile="D:\...\logs\nlog-internal.log"&gt;
  
    &lt;!--Define Various Log Targets like files, database or asp.net trace files--&gt;
    &lt;targets&gt;
      &lt;target name="console" xsi:type="ColoredConsole" layout="${message}" /&gt;
      &lt;!--Write logs to File  where we want to write error logs--&gt;
      &lt;target name="file"              
          archiveFileName="logs/archives/app-log.{#}.txt" 
          archiveEvery="Day" 
          archiveNumbering="Rolling" 
          maxArchiveFiles="7" 
          xsi:type="File" 
          fileName="D:\...\logs\ErrorLogFile.log" 
          layout="--------------------- ${level} (${longdate}) ${machinename} --------------------
          ${newline}      
          ${newline}
          Additional Info  : ${message}${newline}
          Exception Type   : ${exception:format=Type}${newline}
          Exception Message: ${exception:format=Message}${newline}
          Stack Trace      : ${exception:format=Stack Trace}${newline}
  
          "&gt;
      &lt;/target&gt;
  
    &lt;/targets&gt;
  
    &lt;rules&gt;
      &lt;logger name="*" minlevel="Trace" writeTo="file" /&gt;
  
    &lt;/rules&gt;
  &lt;/nlog&gt;
  </code></pre>
  
  <p>internalLogLevel="Debug" output:</p>
  
  <pre><code>2018-09-20 19:26:10.4825 Debug ScanAssembly('NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c')
  2018-09-20 19:26:10.5275 Debug Search for auto loading files, location: C:\inetpub\wwwroot\Test
  2018-09-20 19:26:10.5275 Debug Start auto loading, location: C:\inetpub\wwwroot\Test
  2018-09-20 19:26:10.5345 Debug Auto loading done
  2018-09-20 19:26:10.5345 Info Message Template Auto Format enabled
  2018-09-20 19:26:10.5345 Debug Setting 'UppercaseLayoutRendererWrapper.uppercase' to 'true'
  2018-09-20 19:26:10.5345 Debug Setting 'ColoredConsoleTarget.name' to 'console'
  2018-09-20 19:26:10.5345 Debug Setting 'ColoredConsoleTarget.layout' to '${message}'
  2018-09-20 19:26:10.5345 Info Adding target ColoredConsole Target[console]
  2018-09-20 19:26:10.5345 Debug Registered target console: NLog.Targets.ColoredConsoleTarget
  2018-09-20 19:26:10.5525 Debug Setting 'UppercaseLayoutRendererWrapper.uppercase' to 'true'
  2018-09-20 19:26:10.5525 Debug Setting 'FileTarget.name' to 'file'
  2018-09-20 19:26:10.5525 Debug Setting 'FileTarget.archiveFileName' to 'logs/archives/app-log.{#}.txt'
  2018-09-20 19:26:10.5525 Debug Setting 'FileTarget.archiveEvery' to 'Day'
  2018-09-20 19:26:10.5525 Debug Setting 'FileTarget.archiveNumbering' to 'Rolling'
  2018-09-20 19:26:10.5525 Debug Setting 'FileTarget.maxArchiveFiles' to '7'
  2018-09-20 19:26:10.5525 Debug Setting 'FileTarget.fileName' to 'C:\temp\logs\ErrorLogFile.log'
  2018-09-20 19:26:10.5525 Debug Setting 'FileTarget.layout' to '--------------------- ${level} (${longdate}) ${machinename} -------------------- ${newline} ${newline} Additional Info : ${message}${newline} Exception Type : ${exception:format=Type}${newline} Exception Message: ${exception:format=Message}${newline} Stack Trace : ${exception:format=Stack Trace}${newline} '
  2018-09-20 19:26:10.5795 Debug Setting 'ExceptionLayoutRenderer.format' to 'Type'
  2018-09-20 19:26:10.5815 Debug Setting 'ExceptionLayoutRenderer.format' to 'Message'
  2018-09-20 19:26:10.5815 Debug Setting 'ExceptionLayoutRenderer.format' to 'Stack Trace'
  2018-09-20 19:26:10.5815 Info Adding target File Target[file]
  2018-09-20 19:26:10.5815 Debug Registered target file: NLog.Targets.FileTarget
  2018-09-20 19:26:10.5815 Info Configured from an XML element in C:\inetpub\wwwroot\Test\NLog.config...
  2018-09-20 19:26:10.5815 Debug Unused target checking is started... Rule Count: 1, Target Count: 2
  2018-09-20 19:26:10.5815 Warn Unused target detected. Add a rule for this target to the configuration. TargetName: console
  2018-09-20 19:26:10.5815 Debug Unused target checking is completed. Total Rule Count: 1, Total Target Count: 2, Unused Target Count: 1
  2018-09-20 19:26:10.5815 Debug --- NLog configuration dump ---
  2018-09-20 19:26:10.5815 Debug Targets:
  2018-09-20 19:26:10.5815 Debug ColoredConsole Target[console]
  2018-09-20 19:26:10.5815 Debug File Target[file]
  2018-09-20 19:26:10.5815 Debug Rules:
  2018-09-20 19:26:10.5815 Debug logNamePattern: (:All) levels: [ Trace Debug Info Warn Error Fatal ] appendTo: [ file ]
  2018-09-20 19:26:10.5815 Debug --- End of NLog configuration dump ---
  2018-09-20 19:26:10.5815 Info Found 23 configuration items
  2018-09-20 19:26:10.6105 Debug Watching path 'C:\inetpub\wwwroot\Test' filter 'NLog.config' for changes.
  2018-09-20 19:26:10.6115 Info Configuration initialized.
  2018-09-20 19:26:10.6115 Info NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 4.5.7.7958. Product version: 4.5.7.
  2018-09-20 19:26:10.6115 Debug Targets for Data.Repositories.CommonRepository by level:
  2018-09-20 19:26:10.6115 Debug Trace =&gt; file
  2018-09-20 19:26:10.6115 Debug Debug =&gt; file
  2018-09-20 19:26:10.6115 Debug Info =&gt; file
  2018-09-20 19:26:10.6115 Debug Warn =&gt; file
  2018-09-20 19:26:10.6115 Debug Error =&gt; file
  2018-09-20 19:26:10.6115 Debug Fatal =&gt; file
  2018-09-20 19:26:10.6405 Debug Targets for Emailer.EmailManager by level:
  2018-09-20 19:26:10.6405 Debug Trace =&gt; file
  2018-09-20 19:26:10.6405 Debug Debug =&gt; file
  2018-09-20 19:26:10.6405 Debug Info =&gt; file
  2018-09-20 19:26:10.6405 Debug Warn =&gt; file
  2018-09-20 19:26:10.6405 Debug Error =&gt; file
  2018-09-20 19:26:10.6405 Debug Fatal =&gt; file
  2018-09-20 19:26:10.6435 Debug Targets for UI.Controllers.BaseController by level:
  2018-09-20 19:26:10.6435 Debug Trace =&gt; file
  2018-09-20 19:26:10.6435 Debug Debug =&gt; file
  2018-09-20 19:26:10.6435 Debug Info =&gt; file
  2018-09-20 19:26:10.6435 Debug Warn =&gt; file
  2018-09-20 19:26:10.6435 Debug Error =&gt; file
  2018-09-20 19:26:10.6435 Debug Fatal =&gt; file
  2018-09-20 19:26:10.7735 Debug FileTarget(Name=file): Process file 'C:\temp\logs\ErrorLogFile.log' on startup
  2018-09-20 19:26:10.7735 Debug Creating file appender: C:\temp\logs\ErrorLogFile.log
  </code></pre>
  
  <p>MVC 5 project. .Net 4.5.2. NLog version 4.5.7</p>
  
  <p>I also use SignalR in the project.  The log folder has modify rights for IIS_IUSRS. </p>
  
  <p>Any help appreciated.</p>