What problem does it solve?
Serilog helps you produce structured, queryable application logs that stay consistent across startup, DI, configuration, and production environments.
Core Features & Use Cases
- Two-stage logging for reliable startup diagnostics: Use a bootstrap logger to capture startup failures, then switch to the full DI/configured logger.
- Configuration-driven sinks, levels, enrichers, and overrides: Centralize behavior in appsettings.json for per-environment changes without redeploying.
- Structured logging, destructuring, and contextual enrichment: Emit message templates, preserve object structure with targeted destructuring, and attach request/scope properties via LogContext and request logging middleware.
- Filtering and telemetry integration: Use Serilog.Expressions for expression-based filtering and optionally export directly via the OTLP sink.
Quick Start
Ask the AI to generate an appsettings.json plus minimal .NET 10 startup code that configures Serilog with appsettings-driven sinks, structured request logging, LogContext enrichment, and safe destructuring limits.