What problem does it solve?
Modern .NET applications often produce noisy, unstructured logs, lose startup errors before DI is initialized, and lack consistent request tracing and health endpoints needed for reliable monitoring and incident investigation. This Skill helps teams establish structured, searchable logs, deterministic request summaries, correlation IDs, health checks, and telemetry exports so production issues are detectable and diagnosable.
Core Features & Use Cases
- Structured logging with Serilog using message templates and destructuring limits to produce queryable events.
- Two-stage bootstrap to capture startup failures and then replace the logger with a DI-aware configuration via AddSerilog().
- Request logging and scoped properties (UseSerilogRequestLogging and LogContext.PushProperty) to produce single-line request summaries enriched with user and request metadata.
- Correlation ID propagation middleware that attaches a consistent X-Correlation-Id across requests and logs.
- Configuration-driven sinks and filters via appsettings.json and Serilog.Expressions for environment-specific routing and noise suppression.
- OpenTelemetry/OTLP integration and health checks for metrics, traces, and readiness/liveness endpoints in microservices.
Quick Start
Add a two-stage Serilog bootstrap to your ASP.NET Core app, configure AddSerilog() to read sinks and destructuring from appsettings.json, enable UseSerilogRequestLogging with correlation ID middleware, and add an OTLP exporter for traces and metrics.