A Serilog configuration provider that reads settings from Microsoft.Extensions.Configuration sources like appsettings.json.
Serilog.Settings.Configuration is a configuration provider for the Serilog logging library in .NET. It allows developers to configure Serilog through Microsoft.Extensions.Configuration sources, such as `appsettings.json`, enabling structured logging setup via configuration files rather than code. This simplifies managing log sinks, levels, enrichers, and filters across different environments.
.NET developers using Serilog for structured logging who want to externalize logging configuration using .NET's standard configuration system, particularly in ASP.NET Core or other modern .NET applications.
Developers choose Serilog.Settings.Configuration because it integrates Serilog seamlessly with the familiar .NET configuration paradigm, supports dynamic reloading, reduces boilerplate code through auto-discovery, and provides flexible syntax for complex logging scenarios.
A Serilog configuration provider that reads from Microsoft.Extensions.Configuration
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Reads directly from standard Microsoft.Extensions.Configuration sources like appsettings.json, allowing logging settings to be managed alongside other app configurations, as shown in the main example.
Supports hot-reloading when configured with reloadOnChange, enabling runtime updates to log levels and switches without application restart, as detailed in the MinimumLevel section.
Automatically discovers Serilog packages from project dependencies using .deps.json files, reducing manual assembly references in configuration for .NET Core and compatible projects.
Handles complex parameter types including IConfiguration sections, static members, and nested configurations, enabling advanced sink and enricher setups without code changes.
Auto-discovery does not work for .NET 5.0+ single-file applications, requiring explicit Using sections or assembly lists, as admitted in the README.
Dynamic reloading does not support inserting new records in the MinimumLevel Override section at runtime, limiting flexibility for evolving logging sources.
Non-standard environments like Azure Functions require manual steps such as modifying csproj files and handling DependencyContext, which can be error-prone and time-consuming.