PreEmptive Analytics Data Hub User Guide

Logging

During installation, the Endpoint Web Service and Dispatch Service are both configured to log warning and error messages to the Windows Event Log, using the NLog logging platform. This configuration can be modified to display more detailed logging, or to log to other targets such as log files.

To modify the logging configuration:

  1. Open [Application folder]\Web\NLog.config for the Endpoint Web Service, or [Application folder]\DispatchService\NLog.exe.config for the Dispatch Service.
  2. Modify the NLog configuration file according to your needs.
  3. Save the file.
  4. No restart should be required - the changes will be picked up automatically.

If your logging configuration changes have problems (e.g. invalid syntax), those errors will be logged to C:\ProgramData\PreEmptive Solutions\PreEmptive Analytics Data Hub, in endpoint-nlog-errors.txt or dispatch-nlog-errors.txt.

Example: Configuring the Endpoint Web Service to log INFO-level messages to file

<?xml version="1.0" encoding="utf-8"?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  internalLogFile="C:\ProgramData\PreEmptive Solutions\PreEmptive Analytics Data Hub\endpoint-nlog-errors.txt"
  internalLogLevel="Warn" autoReload="true">
  <targets>
    <target name="warns"
              type="EventLog"
              layout="${longdate}|${level:uppercase=true}|${logger}|${message}  ${exception:separator=&#xD;&#xA;:format=message,tostring}"
              source="HubEndpoint"
              log="PA Data Hub"/>
    <target name="logfile"
              type="File"
              fileName="C:\ProgramData\PreEmptive Solutions\PreEmptive Analytics Data Hub\endpoint-${shortdate}.log"
            />
  </targets>
  <rules>
    <logger name="*" minlevel="Warn" writeTo="warns"/>
    <logger name="*" minlevel="Info" writeTo="logfile" />
  </rules>
</nlog>

Note: The Dispatch Service logging deliberately omits logging from the "ServiceClientBase" logger, as it is redundant with more detailed information provided by the "PaHub.MessageDispatch".


Data Hub User Guide Version 1.3.0. Copyright © 2014 PreEmptive Solutions, LLC