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
<PackageReference Include="Soenneker.Extensions.Configuration.Logging" Version="4.0.209" />
<PackageVersion Include="Soenneker.Extensions.Configuration.Logging" Version="4.0.209" />
<PackageReference Include="Soenneker.Extensions.Configuration.Logging" />
paket add Soenneker.Extensions.Configuration.Logging --version 4.0.209
#r "nuget: Soenneker.Extensions.Configuration.Logging, 4.0.209"
#:package Soenneker.Extensions.Configuration.Logging@4.0.209
#addin nuget:?package=Soenneker.Extensions.Configuration.Logging&version=4.0.209
#tool nuget:?package=Soenneker.Extensions.Configuration.Logging&version=4.0.209
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:
Log:Levels:Defaultis used when present.- Otherwise,
Log:DefaultLogLevelis used when present. - 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 | 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 (>= 4.4.0)
- Soenneker.Extensions.Configuration (>= 4.0.866)
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 |
Update dependency Soenneker.Extensions.Configuration to 4.0.866 (#246)