---
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

<sup><span class="nodinite-new-badge">New 3.0.14</span></sup>

Gain full visibility and control over every LDAP operation with <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span>'s advanced logging capabilities. This guide shows you how to enable, configure, and maximize logging for the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [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 <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [LDAP Web API][].

<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 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 <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [Serilog][] appenders, so you capture every request and response for complete traceability.

|Type|Description|  
|---|---|  
|<i class="fal fa-sign-in" aria-hidden="true"></i> [Request][]|You send a query with potentially changing operations|  
|<i class="fal fa-sign-out" aria-hidden="true"></i> [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 <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> LDAP Web API.*

This feature empowers you to log all operations using the standard logging strategy for <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span>. Use any of the following <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 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><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup> or another text editor. Open the file with administrative privileges so you can save your changes.

You can use any <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 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 <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 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|  

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p>Logged events may include sensitive data! Restrict access to the intermediate storage.</p></div>
</aside>

### 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 <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [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 <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [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": "*"
}
```

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> 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  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> 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]:https://docs.nodinite.com/ldap-web-api/getting-started/configuration/
[LDAP Web API]:https://docs.nodinite.com/ldap-web-api/overview/
[Log Events]:https://docs.nodinite.com/core-services/log-event/overview/
[Monitoring]:https://docs.nodinite.com/ldap-web-api/troubleshooting/monitoring/
[Notepad++]:https://notepad-plus-plus.org/downloads/
[Pickup Log Events Service Logging Agent]:https://docs.nodinite.com/logging-and-monitoring/pickup-logevents-service/overview/
[Request]:https://docs.nodinite.com/ldap-web-api/features/request/
[Response]:https://docs.nodinite.com/ldap-web-api/features/response/
[Serilog]:https://docs.nodinite.com/logging-and-monitoring/serilog/overview/
[Serilog - Blob Storage]:https://docs.nodinite.com/logging-and-monitoring/serilog/features/blob-storage/
[Serilog - File]:https://docs.nodinite.com/logging-and-monitoring/serilog/features/file/