Results Services Logging

Logging of information is important for troubleshooting of services. The following logging options are available:

  • Event: Common for windows-based systems. However, it is not recommended to log more debug or trace information to the event log.
  • Console: The default for Docker-based systems.
  • File: Allows more detailed logging into rolling files.
  • ApplicationInsight: A Microsoft Azure technology that can be used for logging and monitoring.
  • MinimumLevel: Set the level that is sent to the log. The available options are:
    1. Critical
    2. Error
    3. Warning
    4. Information
    5. Debug
    6. Trace
    7. None 
  1. EnableAppInsight: Set to "True" to use Application Insights
  2. InsightKey: The key of an Application Insights Instance
  3. EventLogRestictedToMinimumLevel: Set the minimum level for event log logging
  4. EventLogManagedEventSource: Set to "True" for the service to register the event source. This requires local admin rights for the user running the services.
  5. WriteTo
  6. Enrich

"Serilog": {
      "Using": [ "Serilog.Sinks.Console" ],
      "MinimumLevel": "Information",
      "EnableAppInsight": false,
      "InsightKey": "",
      "EventLogRestrictedToMinimumLevel": "Warning",
      "EventLogOutputTemplate": "{Message}{NewLine}{Exception}",
      "EventLogManageEventSource": false,
      "WriteTo": [
        { "Name": "Console" },
        {
          "Name": "File",
          "Args": {
            "path": ".\\Logs\\ResultSenderLog_.txt",
            "outputTemplate": "{Timestamp:o} [{Level:u3}] ({Application}/{MachineName}) {Message}{NewLine}{Exception}",
            "rollingInterval": "Day",
            "fileSizeLimitBytes": "2097152",
            "rollOnFileSizeLimit": true,
            "retainedFileCountLimit": 2000
          }
        }
      ],
      "Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ],
      "Properties": {
        "Application": "ATS.CM4D.ResultsSender",
        "MachineName": "MachineATS"
      }
  }


Can we improve this topic?