VOOZH about

URL: https://www.nuget.org/packages/nlog.azure.kusto

⇱ NuGet Gallery | NLog.Azure.Kusto 3.1.0




NLog.Azure.Kusto 3.1.0

dotnet add package NLog.Azure.Kusto --version 3.1.0
 
 
NuGet\Install-Package NLog.Azure.Kusto -Version 3.1.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.Azure.Kusto" Version="3.1.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NLog.Azure.Kusto" Version="3.1.0" />
 
Directory.Packages.props
<PackageReference Include="NLog.Azure.Kusto" />
 
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.Azure.Kusto --version 3.1.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NLog.Azure.Kusto, 3.1.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.Azure.Kusto@3.1.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.Azure.Kusto&version=3.1.0
 
Install as a Cake Addin
#tool nuget:?package=NLog.Azure.Kusto&version=3.1.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

NLog.Azure.Kusto

An Azure Data Explorer(ADX) custom target that writes log events to an Azure Data Explorer (Kusto) cluster.

Package - NLog.Azure.Kusto | Platforms - .NET 8.0 + .NET Standard 2.0 + .NET Framework 4.7.2

You can now use the Kusto NLog connector with free Kusto cluster and Microsoft Fabric cluster URLs by providing the cluster URL in the ConnectionString parameter of the ADXTarget configuration.

!! BREAKING CHANGE !!

IngestionEndpoint will not be supported from verison 2.0.0. It has been replaced with Connection String based authentication. With Connection String based authentication, you can use different modes of authentication, such as User Prompt Authentication, User Token Authentication, and more. To learn more about Kusto connection strings and the authentication modes they support, please visit Kusto connection strings.

Getting started

Install from NuGet:

dotnet add package NLog.Azure.Kusto --version 3.1.0

Configuration

Add the ADX target to your NLog configuration:

<nlog>
 <extensions>
 <add assembly="NLog.Azure.Kusto"/>
 </extensions>
 <targets>
 
 <target name="adxtarget" type="ADXTarget"
 ConnectionString="<ADX connection string>"
 Database="<ADX database name>"
 TableName="<ADX table name>">
 <contextproperty name="HostName" layout="${hostname}" /> 
 </target>
 </targets>
 <rules>
 <logger minlevel="Info" name="*" writeTo="adxtarget"/>
 </rules>
</nlog>

Available Configuration Options

Destination Option Description
ConnectionString Kusto connection string. Eg: Data Source=https://ingest-<clustername>.<region>.kusto.windows.net;Fed=True. Read about Kusto Connection String
Database The name of the database to which data should be ingested into.
TableName The name of the table to which data should be ingested.
AuthenticationType Override the Authentication style, instead of ConnectionString providing authentication details
ManagedIdentityClientId Provides the user assigned identity with AuthenticationType = AadUserManagedIdentity
FlushImmediately In case queued ingestion is selected, this property determines if is needed to flush the data immediately to ADX cluster. Not recommended to enable for data with higher workloads. The default is false.
MappingNameRef Use a data mapping configured in ADX.
ApplicationName Override default application-name
ApplicationVersion Override default application-version
Payload Option Description
Layout Formatting of the ADX-event FormattedMessage. The default is: ${logger}${message}
IncludeEventProperties Include LogEvent Properties in the ADX-event. The default is true
ContextProperty Include additional ContextProperties in the ADX-event. The default is empty collection.
BatchSize Gets or sets the number of log events that should be processed in a batch by the lazy writer thread. (Default 1)
TaskDelayMilliseconds How many milliseconds to delay the actual send payload operation to optimize for batching (Default 1 ms)
QueueLimit Gets or sets the limit on the number of requests in the lazy writer thread request queue (Default 10000)
OverflowAction Gets or sets the action (Discard, Grow, Block) to be taken when the lazy writer thread request queue count exceeds the set limit (Default Discard)

IngestionEndpointUri is longer supported with Version 2.0.0, as it has been replaced by Connection String based authentication. Read more about Kusto connection strings

Mapping

Azure Data Explorer provides data mapping capabilities, allowing the ability to extract data rom the ingested JSONs as part of the ingestion. This allows paying a one-time cost of processing the JSON during ingestion, and reduced cost at query time.

By default, the sink uses the following data mapping:

Column Name Column Type JSON Path
Timestamp datetime $.Timestamp
Level string $.Level
Message string $.Message
FormattedMessage dynamic $.FormattedMessage
Exception string $.Exception
Properties dynamic $.Properties

This mapping can be overridden using the following options:

  • MappingNameRef: Use a data mapping configured in ADX.

Authentication

Authentication will be taken according to the kusto connection string passed in the nlog target configuration.

It is also possible to assign AuthenticationType to override the authentication mode.

AuthenticationType Method Notes
None Default Mode ConnectionString provides authentication details
AadUserManagedIdentity WithAadUserManagedIdentity Apply ManagedIdentityClientId as User Assigned Identity
AadSystemManagedIdentity WithAadSystemManagedIdentity Apply System Assigned Managed Identity
AadWorkloadIdentity WithAadAzureTokenCredentialsAuthentication WorkloadIdentityCredential for Kubernetes or other hosts
AddAzCli WithAadAzCliAuthentication Azure CLI Authentication
AadUserPrompt WithAadAzureTokenCredentialsAuthentication Recommended only for development!

Running tests

To run the tests locally, you need to have an ADX cluster created.

  1. Export environment variables for the following:

    • For Windows:

       $env:CONNECTION_STRING="<connectionString>"
       $env:DATABASE="<databaseName>"
      
    • For Mac/Linux:

       export CONNECTION_STRING="<connectionString>"
       export DATABASE="<databaseName>"
      
  2. Run the tests using the following command:

     dotnet test
    
Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 is compatible.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.0 119 5/6/2026
3.0.0 353 12/15/2025
2.1.0 8,095 8/8/2024
2.0.1 9,190 10/5/2023
2.0.0 344 8/17/2023
1.1.0 347 7/7/2023
1.0.0 412 5/22/2023