Logging the swNotificationServer

If you want to set up logging:

  • For versions Olskroken (R43) and earlier, see How to Configure and Start Logging for instructions on creating a swNotificationServer.props file.
  • For versions Kviberg (R44) and later, use the provided swNotificationServer.exe.nlog file. 

swNotificationServer.exe.nlog

<?xml version="1.0" encoding="utf-8" ?>
<!-- XSD manual extracted from package NLog.Schema: https://www.nuget.org/packages/NLog.Schema-->
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xsi:schemaLocation="NLog NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      autoReload="true">
      <!--internalLogFile="c:\temp\console-example-internal.log"
      internalLogLevel="Info" >-->

  <!-- the targets to write to -->
  <targets>
    <!-- write logs to file -->
      <target xsi:type="File" name="logfile" fileName="NotificationServer.log"
            layout="${longdate} [${threadid}] - ${level:uppercase=true}  ${message}${onexception:${newline}EXCEPTION\: ${exception:format=ToString}}" />

    <target xsi:type="ColoredConsole" name="logconsole" detectConsoleAvailable="true"
            layout="${longdate} [${threadid}] - ${level:uppercase=true}  ${message}${onexception:${newline}EXCEPTION\: ${exception:format=ToString}}" />
  </targets>

  <!-- rules to map from logger name to target -->
  <rules>
    <logger name="*" minlevel="Info" writeTo="logfile,logconsole" />
  </rules>
</nlog>
Generic

To specify a location for the file output, include a valid path for fileName, e.g.,: 


 <!-- write logs to file -->
      <target xsi:type="File" name="logfile" fileName="NotificationServer.log"
            layout="${longdate} [${threadid}] - ${level:uppercase=true}  ${message}${onexception:${newline}EXCEPTION\: ${exception:format=ToString}}" />
Generic


If a path is not included, the file will generate in the same location as the notification server executable.