Eigenverft.NetLib.Logging.Bootstrap
1.0.0.5-gdfdd996480
dotnet add package Eigenverft.NetLib.Logging.Bootstrap --version 1.0.0.5-gdfdd996480
NuGet\Install-Package Eigenverft.NetLib.Logging.Bootstrap -Version 1.0.0.5-gdfdd996480
<PackageReference Include="Eigenverft.NetLib.Logging.Bootstrap" Version="1.0.0.5-gdfdd996480" />
<PackageVersion Include="Eigenverft.NetLib.Logging.Bootstrap" Version="1.0.0.5-gdfdd996480" />
<PackageReference Include="Eigenverft.NetLib.Logging.Bootstrap" />
paket add Eigenverft.NetLib.Logging.Bootstrap --version 1.0.0.5-gdfdd996480
#r "nuget: Eigenverft.NetLib.Logging.Bootstrap, 1.0.0.5-gdfdd996480"
#:package Eigenverft.NetLib.Logging.Bootstrap@1.0.0.5-gdfdd996480
#addin nuget:?package=Eigenverft.NetLib.Logging.Bootstrap&version=1.0.0.5-gdfdd996480&prerelease
#tool nuget:?package=Eigenverft.NetLib.Logging.Bootstrap&version=1.0.0.5-gdfdd996480&prerelease
Eigenverft.NetLib.Logging.Bootstrap
Log startup diagnostics before the host is built, using an initialized Serilog logger when available and otherwise a Microsoft logging fallback.
✨ At a glance
| Capability | What it does | Starting point |
|---|---|---|
| Typed logger | Create a logger categorized by a type | BootstrapLogger<TCategoryName>.CreateLogger(...) |
| Named logger | Create a logger with an explicit category name | BootstrapLogger.CreateLogger(...) |
| Automatic backend | Capture an existing Serilog logger or create a Microsoft logging fallback | CreateLogger(...) |
| Required Serilog | Create a Serilog logger from an isolated JSON file and fail if unavailable | CreateRequiredSerilogLogger(...) |
📦 Installation
dotnet add package Eigenverft.NetLib.Logging.Bootstrap
🚀 Quick start
Create the bootstrap logger after configuring the builder but before building the host:
using Eigenverft.NetLib.Logging.Bootstrap;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
var builder = Host.CreateApplicationBuilder(args);
ILogger startupLogger = BootstrapLogger.CreateLogger("Startup", builder.Configuration);
startupLogger.LogInformation(
"Starting in {Environment}",
builder.Environment.EnvironmentName);
using IHost host = builder.Build();
await host.RunAsync();
The first successful factory creation is cached for the process. Later configuration arguments or application logging reconfiguration do not replace the bootstrap channel. The returned factory is process-owned; callers must not dispose it.
🪵 Backend behavior
The automatic API captures the current global Serilog logger when Serilog and its Microsoft logging bridge are available and that logger is not Serilog's built-in silent default. Otherwise it uses Microsoft logging, applying the Logging section and adding Console support when the corresponding extension assemblies are available. The package has no compile-time Serilog dependency; the consuming application supplies Serilog and its bridge if it wants the automatic Serilog path.
For an explicitly required, isolated Serilog setup, the default file is AppSettings/BootstrapLoggerSettings.json beneath AppContext.BaseDirectory:
ILogger<Program> startupLogger =
BootstrapLogger<Program>.CreateRequiredSerilogLogger();
This strict method does not fall back to Microsoft logging. The consuming application must provide Serilog core, Serilog.Settings.Configuration, Serilog.Extensions.Logging, and every sink or enricher named in the file. It reads only that JSON file and section; it does not load the host's other configuration sources. This method should be the first bootstrap-logger initialization in the process. Optional reloadOnChange updates Serilog levels and switches, but does not rebuild its sink pipeline.
LogConfigurationResolution(...) belongs to Eigenverft.NetLib.Configuration.Diagnostics. The early environment helper is in Eigenverft.NetLib.Hosting.DirectoryLayout.
To diagnose provider precedence before host construction, install Eigenverft.NetLib.Configuration.Diagnostics, then call the extension after registering configuration sources and pass the bootstrap logger:
using Eigenverft.NetLib.Configuration.Diagnostics;
using Eigenverft.NetLib.Logging.Bootstrap;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
var builder = Host.CreateApplicationBuilder(args);
ILogger startupLogger = BootstrapLogger.CreateLogger("Startup", builder.Configuration);
builder.LogConfigurationResolution(startupLogger);
using IHost host = builder.Build();
await host.RunAsync();
This is an optional package pairing, not a dependency; the diagnostics report provider origins and key-shadow chains, never configuration values.
🎯 Target frameworks
net8.0net10.0
A .NET 9 consumer can use the compatible net8.0 asset.
🔗 Project links
📄 License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- Microsoft.Extensions.Hosting (>= 10.0.0)
-
net8.0
- Microsoft.Extensions.Hosting (>= 8.0.1)
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0.5-gdfdd996480 | 0 | 9/29/2026 |
| 1.0.0.5-g17613f8942 | 0 | 9/29/2026 |
| 1.0.0.3-g28e841270d | 0 | 9/28/2026 |
| 1.0.0.2-gbac57d8b97 | 0 | 9/11/2026 |
| 1.0.0.2-g9537b96514 | 0 | 9/11/2026 |
Initial capability package extracted from Eigenverft.NetLib.Infrastructure.