Serilog.Sinks.AzureDataExplorer
1.0.2
See the version list below for details.
dotnet add package Serilog.Sinks.AzureDataExplorer --version 1.0.2
NuGet\Install-Package Serilog.Sinks.AzureDataExplorer -Version 1.0.2
<PackageReference Include="Serilog.Sinks.AzureDataExplorer" Version="1.0.2" />
paket add Serilog.Sinks.AzureDataExplorer --version 1.0.2
#r "nuget: Serilog.Sinks.AzureDataExplorer, 1.0.2"
// Install Serilog.Sinks.AzureDataExplorer as a Cake Addin #addin nuget:?package=Serilog.Sinks.AzureDataExplorer&version=1.0.2 // Install Serilog.Sinks.AzureDataExplorer as a Cake Tool #tool nuget:?package=Serilog.Sinks.AzureDataExplorer&version=1.0.2
Serilog.Sinks.AzureDataExplorer
A Serilog sink that writes events to an Azure Data Explorer (Kusto) cluster.
Package - Serilog.Sinks.AzureDataExplorer | Platforms - .Net 6.0
Getting started
Install from NuGet:
Install-Package Serilog.Sinks.AzureDataExplorer
How to use
var log = new LoggerConfiguration()
.WriteTo.AzureDataExplorer(new AzureDataExplorerSinkOptions
{
IngestionEndpointUri = "https://ingest-mycluster.northeurope.kusto.windows.net",
DatabaseName = "MyDatabase",
TableName = "Serilogs"
})
.CreateLogger();
Features
- Supports both Queued and Streaming ingestion
- Supports Data Mappings
- Supports AAD user and applications authentication
- Supports Azure Data Explorer, Azure Synapse Data Explorer and Azure Data Explorer Free-Tier
Options
Batching
- BatchPostingLimit: The maximum number of events to post in a single batch. Defaults to 1000.
- Period: The time to wait between checking for event batches. Defaults to 10 seconds.
- QueueSizeLimit: The maximum number of events that will be held in-memory while waiting to ship them to AzureDataExplorer. Beyond this limit, events will be dropped. The default is 100,000.
Target ADX Cluster
- IngestionEndpointUri: Azure Data Explorer endpoint (Ingestion endpoint for Queued Ingestion, Query endpoint for Streaming Ingestion)
- DatabaseName: The name of the database to which data should be ingested to
- TableName: The name of the table to which data should be ingested to
- UseStreamingIngestion: Whether to use streaming ingestion (reduced latency, at the cost of reduced throughput) or queued ingestion (increased latency, but much higher throughput).
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 |
Exception | string | $.Exception |
Properties | dynamic | $.Properties |
This mapping can be overridden using the following options:
- MappingName: Use a data mapping configured in ADX.
- ColumnsMapping: Use an ingestion-time data mapping.
Authentication
The sink supports authentication using various methods. Use one of the following methods to configure the desired authentication methods:
new AzureDataExplorerSinkOptions()
.WithXXX(...)
Mode | Method | Notes |
---|---|---|
AadUserPrompt | WithAadUserPrompt | Recommended only development! |
AadUserToken | WithAadUserToken | |
AadApplicationCertificate | WithAadApplicationCertificate | |
AadApplicationKey | WithAadApplicationKey | |
AadApplicationSubjectName | WithAadApplicationSubjectName | |
AadApplicationThumbprint | WithAadApplicationThumbprint | |
AadApplicationToken | WithAadApplicationToken | |
AadAzureTokenCredentials | WithAadAzureTokenCredentials |
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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 was computed. 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. |
-
net6.0
- Microsoft.Azure.Kusto.Ingest (>= 10.0.3)
- serilog (>= 2.11.0)
- Serilog.Sinks.PeriodicBatching (>= 2.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added GZip compression when sending data
Improved options default values