Eigenverft.NetLib.Logging.Bootstrap 1.0.0.5-g17613f8942

This is a prerelease version of Eigenverft.NetLib.Logging.Bootstrap.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Eigenverft.NetLib.Logging.Bootstrap --version 1.0.0.5-g17613f8942
                    
NuGet\Install-Package Eigenverft.NetLib.Logging.Bootstrap -Version 1.0.0.5-g17613f8942
                    
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="Eigenverft.NetLib.Logging.Bootstrap" Version="1.0.0.5-g17613f8942" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Eigenverft.NetLib.Logging.Bootstrap" Version="1.0.0.5-g17613f8942" />
                    
Directory.Packages.props
<PackageReference Include="Eigenverft.NetLib.Logging.Bootstrap" />
                    
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 Eigenverft.NetLib.Logging.Bootstrap --version 1.0.0.5-g17613f8942
                    
#r "nuget: Eigenverft.NetLib.Logging.Bootstrap, 1.0.0.5-g17613f8942"
                    
#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 Eigenverft.NetLib.Logging.Bootstrap@1.0.0.5-g17613f8942
                    
#: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=Eigenverft.NetLib.Logging.Bootstrap&version=1.0.0.5-g17613f8942&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Eigenverft.NetLib.Logging.Bootstrap&version=1.0.0.5-g17613f8942&prerelease
                    
Install as a Cake Tool

Eigenverft.NetLib.Logging.Bootstrap

NuGet Version NuGet Downloads Repository CI Targets License

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.0
  • net10.0

A .NET 9 consumer can use the compatible net8.0 asset.

📄 License

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.