NLog.Extensions.AzureDataTables 4.7.0

dotnet add package NLog.Extensions.AzureDataTables --version 4.7.0
                    
NuGet\Install-Package NLog.Extensions.AzureDataTables -Version 4.7.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NLog.Extensions.AzureDataTables" Version="4.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NLog.Extensions.AzureDataTables" Version="4.7.0" />
                    
Directory.Packages.props
<PackageReference Include="NLog.Extensions.AzureDataTables" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NLog.Extensions.AzureDataTables --version 4.7.0
                    
#r "nuget: NLog.Extensions.AzureDataTables, 4.7.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NLog.Extensions.AzureDataTables@4.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NLog.Extensions.AzureDataTables&version=4.7.0
                    
Install as a Cake Addin
#tool nuget:?package=NLog.Extensions.AzureDataTables&version=4.7.0
                    
Install as a Cake Tool

Azure Table Storage and Cosmos Table

Package Name NuGet Description
NLog.Extensions.AzureDataTables NuGet Azure Table Storage or Azure CosmosDb Tables

Table Configuration

Supports both Azure Storage Tables and CosmosDB Tables.

Syntax

<extensions>
  <add assembly="NLog.Extensions.AzureDataTables" /> 
</extensions>

<targets>
  <target xsi:type="AzureDataTables"
          name="String"
          layout="Layout"
          connectionString="String"
          tableName="Layout"
          logTimeStampFormat="O" />
</targets>

General Options

name - Name of the target.

layout - Text to be rendered. Layout Required.

connectionString - Azure storage connection string. Layout. Required unless using serviceUri.

serviceUri - Alternative to ConnectionString, where Managed Identiy is acquired from DefaultAzureCredential.

tableName - Azure table name. Layout

rowKey - Azure Table RowKey. Layout. Default = "InverseTicks_${guid}"

partitionKey - Azure PartitionKey. Layout. Default = ${logger}

logTimeStampFormat - Default Log TimeStamp is set to 'O' for Round-trip format if not specified.

Authentication Options

managedIdentityClientId - Sets ManagedIdentityClientId on DefaultAzureCredentialOptions. Requires serviceUri

managedIdentityResourceId - resourceId for ManagedIdentityResourceId on DefaultAzureCredentialOptions, do not use together with ManagedIdentityClientId. Requires serviceUri.

tenantIdentity - tenantId for DefaultAzureCredentialOptions. Requires serviceUri.

sharedAccessSignature - Access signature for AzureSasCredential authentication. Requires serviceUri.

accountName - accountName for TableSharedKeyCredential authentication. Requires serviceUri and accessKey.

accessKey - accountKey for TableSharedKeyCredential authentication. Requires serviceUri and accountName.

clientAuthId - clientId for ClientSecretCredential authentication. Requires serviceUri, tenantIdentity and clientAuthSecret.

clientAuthSecret - clientSecret for ClientSecretCredential authentication. Requires serviceUri,tenantIdentity and clientAuthId.

Proxy Options

noProxy - Bypasses any system proxy and proxy in ProxyAddress when set to true.

proxyAddress - Address of the proxy server to use (e.g. http://proxyserver:8080).

proxyLogin - Login to use for the proxy server. Requires proxyPassword.

proxyPassword - Password to use for the proxy server. Requires proxyLogin.

useDefaultCredentialsForProxy - Uses the default credentials (System.Net.CredentialCache.DefaultCredentials) for the proxy server. Take precedence over proxyLogin and proxyPassword when set to true.

Dynamic TableEntity

Instead of using the predefined NLogEntity-properties, then one can specify wanted properties:

<extensions>
  <add assembly="NLog.Extensions.AzureDataTables" /> 
</extensions>

<targets>
  <target xsi:type="AzureDataTables"
          name="String"
          connectionString="Layout"
          tableName="Layout">
    <contextproperty name="Level" layout="${level}" />
    <contextproperty name="LoggerName" layout="${logger}" />
    <contextproperty name="Message" layout="${message:raw=true}" />
    <contextproperty name="Exception" layout="${exception:format=tostring}" />
    <contextproperty name="FullMessage" layout="${message}" />
    <contextproperty name="MachineName" layout="${machinename}" />
  </target>
</targets>

It will by default include the hardcoded property LogTimeStamp of type DateTime that contains LogEventInfo.TimeStamp.ToUniversalTime().

  • This can be overriden by having <contextproperty name="LogTimeStamp"> as the first property, where empty property-value means leave out.

Batching Policy

batchSize - Number of EventData items to send in a single batch (Default=100)

taskDelayMilliseconds - Artificial delay before sending to optimize for batching (Default=200 ms)

queueLimit - Number of pending LogEvents to have in memory queue, that are waiting to be sent (Default=10000)

overflowAction - Action to take when reaching limit of in memory queue (Default=Discard)

Retry Policy

taskTimeoutSeconds - How many seconds a Task is allowed to run before it is cancelled (Default 150 secs)

retryDelayMilliseconds - How many milliseconds to wait before next retry (Default 500ms, and will be doubled on each retry).

retryCount - How many attempts to retry the same Task, before it is aborted (Default 0)

Azure Identity Environment

When using ServiceUri (Instead of ConnectionString), then DefaultAzureCredential is used for Azure Identity which supports environment variables:

  • AZURE_CLIENT_ID - For ManagedIdentityClientId / WorkloadIdentityClientId
  • AZURE_TENANT_ID - For TenantId

See also: Set up Your Environment for Authentication

Azure Table Service Size Limits

There are restrictions for how big column values can be:

  • PartitionKey has max limit of 1024 characters
  • RowKey has max limit of 1024 characters
  • Column string-Values has max limit of 32.768 characters

When breaking these limits, then Azure Table Service will discard the data, so NLog AzureDataTables will automatically truncate if needed.

Azure ConnectionString

NLog Layout makes it possible to retrieve settings from many locations.

Lookup ConnectionString from appsettings.json

connectionString="${configsetting:ConnectionStrings.AzureTable}"

  • Example appsettings.json on .NetCore:
  {
    "ConnectionStrings": {
      "AzureTable": "Server=tcp:server.database.windows.net;"
    }
  }
Lookup ConnectionString from app.config

connectionString="${appsetting:ConnectionStrings.AzureTable}"

  • Example app.config on .NetFramework:
  <configuration>
    <connectionStrings>
      <add name="AzureTable" connectionString="Server=tcp:server.database.windows.net;"/>
    </connectionStrings>
  </configuration>
Lookup ConnectionString from environment-variable

connectionString="${environment:AZURESQLCONNSTR_CONNECTION_STRING}"

Lookup ConnectionString from NLog GlobalDiagnosticsContext (GDC)

connectionString="${gdc:AzureTableConnectionString}"

  • Example code for setting GDC-value:
  NLog.GlobalDiagnosticsContext.Set("AzureTableConnectionString", "Server=tcp:server.database.windows.net;");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on NLog.Extensions.AzureDataTables:

Repository Stars
Implem/Implem.Pleasanter
Pleasanter is a no-code/low-code development platform that runs on .NET. You can quickly create business applications with simple operations.
Version Downloads Last Updated
4.7.0 347 11/13/2025
4.6.0 7,963 7/13/2025
4.5.0 694 6/30/2025
4.4.1 14,027 3/5/2025
4.4.0 28,719 6/24/2024
4.3.1 17,854 10/24/2023
4.3.0 1,670 9/15/2023
4.2.0 14,535 5/23/2023
4.1.0 10,954 2/9/2023
4.0.0 6,286 11/10/2022
3.3.1 5,480 10/5/2022
3.3.0 13,436 3/28/2022
3.2.0 6,246 10/15/2021
3.1.0 586 10/5/2021
3.0.0 587 7/20/2021

- Added support for Proxy-options: ProxyAddress, ProxyLogin, ProxyPassword, NoProxy, UseDefaultCredentialsForProxy
- Added support for Authentication-options: ClientAuthId + ClientAuthSecret
- Updated Azure.Identity to ver 1.16.0 (Bug fixes)
- Enabled XML documentation file generation
- Added README.md to nuget-package
     
Docs: https://github.com/JDetmar/NLog.Extensions.AzureStorage/blob/master/src/NLog.Extensions.AzureDataTables/README.md