Soenneker.Extensions.LoggerConfiguration.ApplicationInsights
4.0.1359
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Extensions.LoggerConfiguration.ApplicationInsights --version 4.0.1359
NuGet\Install-Package Soenneker.Extensions.LoggerConfiguration.ApplicationInsights -Version 4.0.1359
<PackageReference Include="Soenneker.Extensions.LoggerConfiguration.ApplicationInsights" Version="4.0.1359" />
<PackageVersion Include="Soenneker.Extensions.LoggerConfiguration.ApplicationInsights" Version="4.0.1359" />
<PackageReference Include="Soenneker.Extensions.LoggerConfiguration.ApplicationInsights" />
paket add Soenneker.Extensions.LoggerConfiguration.ApplicationInsights --version 4.0.1359
#r "nuget: Soenneker.Extensions.LoggerConfiguration.ApplicationInsights, 4.0.1359"
#:package Soenneker.Extensions.LoggerConfiguration.ApplicationInsights@4.0.1359
#addin nuget:?package=Soenneker.Extensions.LoggerConfiguration.ApplicationInsights&version=4.0.1359
#tool nuget:?package=Soenneker.Extensions.LoggerConfiguration.ApplicationInsights&version=4.0.1359
Soenneker.Extensions.LoggerConfiguration.ApplicationInsights
Serilog LoggerConfiguration extensions for wiring Application Insights sinks, levels, and telemetry behavior from application configuration.
Installation
dotnet add package Soenneker.Extensions.LoggerConfiguration.ApplicationInsights
Usage
using Soenneker.Extensions.LoggerConfiguration.ApplicationInsights;
builder.Services.AddApplicationInsightsTelemetry();
builder.Host.UseSerilog((context, services, loggerConfiguration) =>
{
loggerConfiguration.AddApplicationInsightsLogging(services, context.Configuration);
});
Enable the sink through application configuration:
{
"Azure": {
"AppInsights": {
"Enable": true
}
},
"Log": {
"Levels": {
"Default": "Information"
}
}
}
When Azure:AppInsights:Enable is absent or false, the method returns without resolving services or changing the logger configuration. When enabled, it:
- Resolves
TelemetryConfigurationfrom the supplied service provider. - Adds an Application Insights sink using
TelemetryConverter.Traces. - Sets the sink's minimum level from
Log:Levels:Default, then the legacyLog:DefaultLogLevel, thenInformation. - Wraps telemetry writes in Serilog's asynchronous sink.
This extension does not call AddApplicationInsightsTelemetry(), configure an Application Insights connection string, or create Log.Logger. Register and configure Application Insights before the Serilog callback, then create/host the logger through the application's normal Serilog setup. Missing TelemetryConfiguration causes service resolution to throw when the feature is enabled.
The minimum level is read when the sink is added; changing configuration later does not update this sink automatically. Call the method once per LoggerConfiguration, because each call adds another sink and can duplicate telemetry.
Serilog's default async wrapper does not block producers when its buffer is full, so events can be dropped under sustained pressure. Application Insights telemetry can also leave the process; do not include credentials, tokens, or personal data in log properties unless collection and retention are explicitly approved.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Serilog.Sinks.ApplicationInsights (>= 5.0.1)
- Serilog.Sinks.Async (>= 2.1.0)
- Soenneker.Extensions.Configuration.Logging (>= 4.0.212)
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 |
|---|---|---|
| 4.0.1361 | 0 | 9/1/2026 |
| 4.0.1360 | 27 | 8/31/2026 |
| 4.0.1359 | 29 | 8/31/2026 |
| 4.0.1358 | 39 | 8/31/2026 |
| 4.0.1357 | 43 | 8/30/2026 |
| 4.0.1356 | 44 | 8/30/2026 |
| 4.0.1355 | 39 | 8/30/2026 |
| 4.0.1354 | 40 | 8/30/2026 |
| 4.0.1353 | 39 | 8/30/2026 |
| 4.0.1352 | 34 | 8/30/2026 |
| 4.0.1351 | 42 | 8/29/2026 |
| 4.0.1349 | 40 | 8/29/2026 |
| 4.0.1348 | 40 | 8/29/2026 |
| 4.0.1347 | 73 | 8/26/2026 |
| 4.0.1346 | 74 | 8/26/2026 |
| 4.0.1345 | 85 | 8/25/2026 |
| 4.0.1344 | 88 | 8/22/2026 |
| 4.0.1343 | 101 | 8/18/2026 |
| 4.0.1342 | 97 | 8/12/2026 |
| 4.0.1341 | 96 | 8/12/2026 |
Update dependency Soenneker.Extensions.Configuration.Logging to 4.0.212 (#1727)