---
title: LDAP Web API Logging Configuration - Serilog, Audit, Debug, Trace
description: Enable comprehensive logging for LDAP Web API with Serilog. Audit, debug, and trace all LDAP operations using File or Blob Storage sinks. Configure request/response logging for compliance and troubleshooting.
---

# Enable Logging

:new3.0.14:

Gain full visibility and control over every LDAP operation with :Nodinite:'s advanced logging capabilities. This guide shows you how to enable, configure, and maximize logging for the :Nodinite: [LDAP Web API][].

✅ Audit, debug, and trace all LDAP operations in real time  
✅ Achieve true end-to-end logging for compliance and troubleshooting  
✅ Leverage flexible [Serilog][] appenders for on-premises and cloud  
✅ Secure sensitive data and meet enterprise requirements  

>Helps you debug, trace, and audit all LDAP operations performed by the :Nodinite: [LDAP Web API][].

:Nodinite: provides a robust support and maintenance toolset with a **Logging** feature that enables a true end-to-end logging solution. The [LDAP Web API][] integrates seamlessly with :Nodinite: [Serilog][] appenders, so you capture every request and response for complete traceability.

|Type|Description|  
|---|---|  
|:fa-sign-in: [Request][]|You send a query with potentially changing operations|  
|:fa-sign-out: [Response][]|You receive the result from the query|  
|HTTP Context|You choose whether to include HTTP headers|  

<div class="mermaid">
graph LR
    subgraph "Nodinite LDAP Web API"
        roNI(fal:fa-cloud-arrow-down LDAP Web API) -->|"Request"| roLS(fal:fa-file-alt Log Appender)
        roLS --> roIS(fal:fa-file-alt Intermediate Storage)
        roNI -->|"Response"| roLS
    end
    subgraph "Nodinite App Server"
      roIS -.-> roPS(fal:fa-truck-pickup Pickup Service)
      roPS --> roN(Nodinite)
    end
</div>

*Diagram: End-to-end flow of LDAP operations and logging in :Nodinite: LDAP Web API.*

This feature empowers you to log all operations using the standard logging strategy for :Nodinite:. Use any of the following :Nodinite: Serilog appenders to create a JSON-based [Log Event][Log Events]. You use the [Pickup Log Events Service Logging Agent][].

## Configuration Files

To enable logging, update the following files:

* [settings.json](#settings.json)  
* appsettings.json  
  * [File](#appsettings.json-file)  
  * [Blob](#appsettings.json-blob)  

Use [Notepad++][]<sup>:fa-arrow-up-right-from-square:</sup> or another text editor. Open the file with administrative privileges so you can save your changes.

You can use any :Nodinite: Serilog sink (or any compatible custom/third-party sink) as long as you use a supported version of Serilog. We publish new versions after every patch Tuesday.

We ship the binaries with the following :Nodinite: Serilog sinks:

* [File Sink][Serilog - File] (ideal for on-premises solutions)  
  * Name: `Nodinite.Serilog.FileSink`  
  * Folder: `C:\Temp\Nodinite\LDAP`  
  * **Args**  
    * FileExtension: ".json"  
* [Azure Blob Storage][Serilog - Blob Storage] (ideal for Azure/cloud solutions)  
  * Name: `Nodinite.Serilog.AzureBlobStorageSink`  
  * Connect with the container using any of the following, as described in the Blob Storage documentation:  
    * Connection string (example on this page)  
    * System managed identity  
    * Named managed identity  

In the `settings.json` file, the following fields determine what to include in the logging:

|Field|Value example|Description|  
|---|---|---|  
|**LogRequest**|`true` or `false`|Flag to indicate whether to log the Request|  
|**LogResponse**|`true` or `false`|Flag to indicate whether to log the Response|  
|**LogHttpHeaders**|`true` or `false`|Flag to indicate whether to log HTTP Headers|  

>[!IMPORTANT]
>Logged events may include sensitive data! Restrict access to the intermediate storage.

### settings.json

```json
{
  "LogRequest": true,
  "LogResponse": true,
  "LogHttpHeaders": true,
  "RunningInAzure": null,
  "Connections": [
    {
      "Id": "f8caa70f-e9eb-4e39-a93f-6c7ee302bdb8",
      "AuthenticationType": 2,
      "DSAServer": "DC01",
      "DSAServerPort": 389,
      "UserName": "DEV\\Administrator",
      "Password": "Password",
      "KeyVaultPassword": null
    }
  ]
}
```

## File Example Settings

Below is an example enabling logging using the :Nodinite: [File][Serilog - File] sink Serilog appender.  

### appsettings.json (file)

```json
{
  "https_port": 443,
  "ProductKey": {
    "CustomerName": "CustomerName",
    "Key": "ProductKey"
  },
  "ConnectionStrings": {
    "appConfiguration": ""
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "Serilog": {
    "Using": [ "Nodinite.Serilog.FileSink" ],
    "WriteTo": [
      {
        "Name": "NodiniteFileSink",
        "Args": {
          "Folder": "C:\\Temp\\Nodinite\\LDAP",
          "Settings": {
            "LogAgentValueId": 503,
            "LogOnlyMessagesWithBody": "false",
            "FileExtension": ".json"
          }
        }
      }
    ]
  },
  "AppConfigEndpoint": "https://devsettings.azconfig.io",
  "AllowedHosts": "*"
}
```

## Blob Storage Example

Below is an example enabling logging using the :Nodinite: [Blob Storage][Serilog - Blob Storage] sink Serilog appender.  

### appsettings.json (Blob)

```json
{
  "https_port": 443,
  "ProductKey": {
    "CustomerName": "CustomerName",
    "Key": "ProductKey"
  },
  "ConnectionStrings": {
    "appConfiguration": ""
  },
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "Serilog": {
    "Using": [ "Nodinite.Serilog.AzureBlobStorageSink" ],
    "WriteTo": [
      {
        "Name": "NodiniteAzureBlobStorageSinkWithConnectionString",
        "Args": {
          "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=Contoso;AccountKey=xyz;EndpointSuffix=core.windows.net",
          "ContainerName": "logevents",
          "Settings": {
            "LogAgentValueId": 503,
            "LogOnlyMessagesWithBody": "false",
            "FileExtension": ".json"
          }
        }
      }
    ]
  },
  "AppConfigEndpoint": "https://devsettings.azconfig.io",
  "AllowedHosts": "*"
}
```

## :fa-hand-point-right: Next Steps

* Learn more about [Serilog][] integration for advanced logging  
* Explore the [Pickup Log Events Service Logging Agent][] for automated log collection  
* Review [LDAP Web API][] features and configuration  

## :fa-link-horizontal: Related Topics

* [LDAP Web API Overview][LDAP Web API]  
* [Serilog - File][Serilog - File]  
* [Serilog - Blob Storage][Serilog - Blob Storage]  
* [Configuration][] - connection settings in `settings.json`  
* [Monitoring][] - alert on errors in the log files  

[Configuration]:{ndr}/LDAP%20Web%20API/Getting%20started/3.%20Configuration.md
[LDAP Web API]:{ndr}/LDAP%20Web%20API/Overview.md
[Log Events]:{ndr}/Core%20Services/Log%20Event/Overview.md
[Monitoring]:{ndr}/LDAP%20Web%20API/Troubleshooting/Monitoring.md
[Notepad++]:https://notepad-plus-plus.org/downloads/
[Pickup Log Events Service Logging Agent]:{ndr}/Logging%20and%20Monitoring/Pickup%20LogEvents%20Service/Overview.md
[Request]:{ndr}/LDAP%20Web%20API/Features/Request.md
[Response]:{ndr}/LDAP%20Web%20API/Features/Response.md
[Serilog]:{ndr}/Logging%20and%20Monitoring/Serilog/Overview.md
[Serilog - Blob Storage]:{ndr}/Logging%20and%20Monitoring/Serilog/Features/Blob%20Storage.md
[Serilog - File]:{ndr}/Logging%20and%20Monitoring/Serilog/Features/File.md