Soenneker.Extensions.Configuration.Logging 4.0.211

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.Configuration.Logging --version 4.0.211
                    
NuGet\Install-Package Soenneker.Extensions.Configuration.Logging -Version 4.0.211
                    
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.211" />
                    
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.211" />
                    
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.211
                    
#r "nuget: Soenneker.Extensions.Configuration.Logging, 4.0.211"
                    
#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.211
                    
#: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.211
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Configuration.Logging&version=4.0.211
                    
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

Builds cached Microsoft loggers backed by Serilog and exposes a shared runtime level switch.

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.213 0 8/31/2026
4.0.212 31 8/31/2026
4.0.211 56 8/31/2026
4.0.210 661 8/30/2026
4.0.209 3,006 8/30/2026
4.0.208 54 8/30/2026
4.0.207 53 8/30/2026
4.0.206 55 8/30/2026
4.0.205 49 8/29/2026
4.0.204 2,212 8/29/2026
4.0.203 780 8/29/2026
4.0.202 44,942 8/26/2026
4.0.201 875 8/26/2026
4.0.200 727 8/25/2026
4.0.199 11,023 8/21/2026
4.0.198 19,907 8/18/2026
4.0.197 13,283 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
Loading failed

Update dependency Soenneker.Extensions.Configuration to 4.0.869 (#248)