Soenneker.Extensions.LoggerConfiguration.ApplicationInsights 4.0.1356

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.1356
                    
NuGet\Install-Package Soenneker.Extensions.LoggerConfiguration.ApplicationInsights -Version 4.0.1356
                    
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.1356" />
                    
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.1356" />
                    
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.1356
                    
#r "nuget: Soenneker.Extensions.LoggerConfiguration.ApplicationInsights, 4.0.1356"
                    
#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.1356
                    
#: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.1356
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.LoggerConfiguration.ApplicationInsights&version=4.0.1356
                    
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 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
Loading failed

Update dependency Soenneker.Extensions.Configuration.Logging to 4.0.209 (#1721)