Soenneker.Extensions.LoggerConfiguration.ApplicationInsights 4.0.1354

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.LoggerConfiguration.ApplicationInsights --version 4.0.1354
                    
NuGet\Install-Package Soenneker.Extensions.LoggerConfiguration.ApplicationInsights -Version 4.0.1354
                    
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="Soenneker.Extensions.LoggerConfiguration.ApplicationInsights" Version="4.0.1354" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.LoggerConfiguration.ApplicationInsights" Version="4.0.1354" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.LoggerConfiguration.ApplicationInsights" />
                    
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 Soenneker.Extensions.LoggerConfiguration.ApplicationInsights --version 4.0.1354
                    
#r "nuget: Soenneker.Extensions.LoggerConfiguration.ApplicationInsights, 4.0.1354"
                    
#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 Soenneker.Extensions.LoggerConfiguration.ApplicationInsights@4.0.1354
                    
#: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=Soenneker.Extensions.LoggerConfiguration.ApplicationInsights&version=4.0.1354
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.LoggerConfiguration.ApplicationInsights&version=4.0.1354
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image 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 TelemetryConfiguration from the supplied service provider.
  • Adds an Application Insights sink using TelemetryConverter.Traces.
  • Sets the sink's minimum level from Log:Levels:Default, then the legacy Log:DefaultLogLevel, then Information.
  • 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 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. 
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
4.0.1361 36 9/1/2026
4.0.1360 54 8/31/2026
4.0.1359 49 8/31/2026
4.0.1358 56 8/31/2026
4.0.1357 59 8/30/2026
4.0.1356 59 8/30/2026
4.0.1355 53 8/30/2026
4.0.1354 57 8/30/2026
4.0.1353 55 8/30/2026
4.0.1352 49 8/30/2026
4.0.1351 58 8/29/2026
4.0.1349 56 8/29/2026
4.0.1348 56 8/29/2026
4.0.1347 80 8/26/2026
4.0.1346 81 8/26/2026
4.0.1345 93 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
Loading failed

Document Application Insights sink setup