- 3 minutes to read

Enable Logging

Helps you debug, trace and audit all LDAP operations

Nodinite is a support and maintenance tool with a Logging feature enabling true end to end logging. The LDAP Web API uses the Nodinite SeriLog appenders.

Request Query with potentially changing operations
Response Result from query
graph LR subgraph "Nodinite LDAP Web API" roNI(fal:fa-cloud-download LDAP Web API) --> |Request| roLS(fal:fa-file-alt Log Appender) roLS --> roIS(fal:fa-file-alt Intermediate Storage) roNI --> |Response| roLS end

Support for logging using SeriLog was introduced with the 2.0.0.0 version of the LDAP Web API. This is very handy since all operations can now be logged using the standard logging strategy for Nodinite. Use any of the following Nodinite SeriLog appenders to create a JSON based Log Event. You should use the Pickup LogEvents Service Logging Agent.

Configuration file (appsettings.json)

The appsettings.json file must be edited manually. Use Notepad++ or some other text editor. Open the file with administrative privileges so you have the rights to save it once your typing is complete.

There is a special property BodyLogging that is default false. Set this property to true to get the actual Request and Response message part of the logged event.

These may include sensitive data

The following Nodinite sinks can be used (any other custom/3rd party sink can be used as well):

  • File
  • Service Bus

File

  • Name: Nodinite.Serilog.FileSink

Service Bus

  • Name: Nodinite.Serilog.ServiceBusSink
{
  "Serilog": {
    "Using": [ "Nodinite.Serilog.ServiceBusSink" ],
    "WriteTo": [
....

Full File example

{
   "ProductKey": {
    "CustomerName": "CustomerName",
    "Key": "yourproductkey"
  },
  "LdapSettings": {
    "Settings": [
      {
        "AuthenticationType": 65,
        "Id": "5a95449b-95a6-4a9b-bfb4-f5292cbd3122",
        "DSAServer": "WILDWESTAD01",
        "DSAServerPort": 636,
        "UserName": "WildWest\\LDAPServiceAccount",
        "Password": "myverys3cretP4$$w0rd!"
      }
    ],
	  "BodyLogging": true
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "Serilog": {
    "Using": [ "Nodinite.Serilog.FileSink" ],
    "WriteTo": [
      {
        "Name": "NodiniteFileSink",
        "Args": {
          "Folder": "C:\\Temp\\pickup",
          "Settings": {
            "LogAgentValueId": 503,
            "EndPointName": "Nodinite.Serilog.LDAPAdapter.API",
            "EndPointUri": "/api/executexml",
            "EndPointDirection": 0,
            "EndPointTypeId": 0,
            "OriginalMessageTypeName": "Nodinite.LDAP.Message",
            "ProcessingUser": "NODINITE",
            "ProcessName": "Nodinite.Serilog.FileSink.Tests",
            "ProcessingMachineName": "NODINITE-DEV",
            "ProcessingModuleName": "DOTNETCORE.TESTS",
            "ProcessingModuleType": "DOTNETCORE.TESTPROJECT"
          }
        }
      }
    ]
  },
  "AllowedHosts": "*"
}

Full ServiceBus example

{
   "ProductKey": {
    "CustomerName": "CustomerName",
    "Key": "yourproductkey"
  },
  "LdapSettings": {
    "Settings": [
      {
        "AuthenticationType": 65,
        "Id": "5a95449b-95a6-4a9b-bfb4-f5292cbd3122",
        "DSAServer": "WILDWESTAD01",
        "DSAServerPort": 636,
        "UserName": "WildWest\\LDAPServiceAccount",
        "Password": "myverys3cretP4$$w0rd!"
      }
    ],
	  "BodyLogging": true
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
"Serilog": {
    "Using": [ "Nodinite.Serilog.ServiceBusSink" ],
    "WriteTo": [
      {
        "Name": "NodiniteServiceBusSink",
        "Args": {
          "ConnectionString": "",
          "QueueName":  "",
          "Settings": {
            "LogAgentValueId": 503,
            "EndPointName": "Nodinite.Serilog.ServiceBusSink.Tests",
            "EndPointUri": "Nodinite.Serilog.ServiceBusSink.Tests.Serilog",
            "EndPointDirection": 0,
            "EndPointTypeId": 0,
            "OriginalMessageTypeName": "Serilog.LogEvent",
            "ProcessingUser": "NODINITE",
            "ProcessName": "Nodinite.Serilog.ServiceBusSink.Tests",
            "ProcessingMachineName": "NODINITE-DEV",
            "ProcessingModuleName": "DOTNETCORE.TESTS",
            "ProcessingModuleType": "DOTNETCORE.TESTPROJECT"
          }
        }
      }
    ]
  },
  "AllowedHosts": "*"
}