Soenneker.Extensions.Configuration.Logging 4.0.209

Prefix Reserved
dotnet add package Soenneker.Extensions.Configuration.Logging --version 4.0.209
                    
NuGet\Install-Package Soenneker.Extensions.Configuration.Logging -Version 4.0.209
                    
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.Configuration.Logging" Version="4.0.209" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.Configuration.Logging" Version="4.0.209" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.Configuration.Logging" />
                    
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.Configuration.Logging --version 4.0.209
                    
#r "nuget: Soenneker.Extensions.Configuration.Logging, 4.0.209"
                    
#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.Configuration.Logging@4.0.209
                    
#: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.Configuration.Logging&version=4.0.209
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Configuration.Logging&version=4.0.209
                    
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.Configuration.Logging

Resolves a Serilog LogEventLevel from IConfiguration using a preferred key and a backward-compatible legacy key.

Installation

dotnet add package Soenneker.Extensions.Configuration.Logging

Configuration

Use Log:Levels:Default for new applications:

{
  "Log": {
    "Levels": {
      "Default": "Information"
    }
  }
}

Log:DefaultLogLevel remains supported for applications using the earlier configuration shape:

{
  "Log": {
    "DefaultLogLevel": "Warning"
  }
}

Supported values are Verbose, Debug, Information, Warning, Error, and Fatal. Matching is case-insensitive.

Usage

using Soenneker.Extensions.Configuration.Logging;
using Serilog;

var level = configuration.GetLogEventLevel();

Log.Logger = new LoggerConfiguration()
    .MinimumLevel.Is(level)
    .WriteTo.Console()
    .CreateLogger();

Resolution is deterministic:

  1. Log:Levels:Default is used when present.
  2. Otherwise, Log:DefaultLogLevel is used when present.
  3. When neither key exists, the result is Information.

An explicitly configured but unsupported value throws InvalidOperationException. This prevents a typo in the preferred key from being hidden by the legacy key or an unexpectedly permissive fallback.

The extension only resolves the level. It does not create a logger, add sinks, reload configuration, or change Serilog's global logger.

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 (3)

Showing the top 3 NuGet packages that depend on Soenneker.Extensions.Configuration.Logging:

Package Downloads
Soenneker.Utils.Logger

A useful utility library dealing with Serilog logging

Soenneker.Extensions.LoggerConfiguration.ApplicationInsights

Serilog LoggerConfiguration extension methods related to Application Insights

Soenneker.Extensions.LoggerConfiguration.Hangfire

Serilog LoggerConfiguration extension methods related to Hangfire

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.209 0 8/30/2026
4.0.208 0 8/30/2026
4.0.207 0 8/30/2026
4.0.206 0 8/30/2026
4.0.205 0 8/29/2026
4.0.204 34 8/29/2026
4.0.203 52 8/29/2026
4.0.202 12,871 8/26/2026
4.0.201 873 8/26/2026
4.0.200 723 8/25/2026
4.0.199 11,018 8/21/2026
4.0.198 19,907 8/18/2026
4.0.197 13,277 8/12/2026
4.0.196 2,036 8/12/2026
4.0.195 42,569 8/8/2026
4.0.194 16,928 8/7/2026
4.0.193 19,219 7/29/2026
4.0.192 2,954 7/29/2026
4.0.191 17,525 7/28/2026
4.0.190 135 7/28/2026
Loading failed

Update dependency Soenneker.Extensions.Configuration to 4.0.866 (#246)