cck-logging

Configure Serilog structured logging, OpenTelemetry tracing, metrics, and health endpoints for .NET 10 applications.

2|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/s205109/AHKFlowApp --skill cck-logging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cck-logging
Source: https://github.com/s205109/AHKFlowApp/tree/main/.claude/skills/cck-logging
Command: npx skills add https://github.com/s205109/AHKFlowApp --skill cck-logging

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about cck-logging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Serilog structured logging in ASP.NET Core without losing startup errors?

Serilog structured logging in ASP.NET Core uses a two-stage bootstrap to capture startup failures before DI is initialized, then replaces the logger with a DI-aware configuration via AddSerilog to produce queryable events.

What is the best way to propagate a correlation ID across .NET microservices for request tracing?

Correlation ID propagation in .NET microservices uses middleware to attach a consistent X-Correlation-Id across requests and logs, ensuring distributed traces remain linked for incident investigation.

How do I set up OpenTelemetry tracing and health checks in .NET 10?

OpenTelemetry tracing and health checks in .NET 10 are set up by configuring an OTLP exporter for metrics and traces alongside readiness and liveness endpoints to make production issues detectable.

Can I configure Serilog sinks and filters via appsettings.json?

Yes, Serilog sinks and filters can be configured via appsettings.json using Serilog.Expressions for environment-specific routing, destructuring limits, and noise suppression without hardcoding sink logic.

How does Serilog request logging work with scoped properties?

Serilog request logging uses UseSerilogRequestLogging and LogContext.PushProperty to generate single-line request summaries enriched with user and request metadata for deterministic observability.

Do I need a two-stage Serilog bootstrap for my ASP.NET Core service?

A two-stage Serilog bootstrap is needed for ASP.NET Core services to capture early startup errors before dependency injection is ready, then transition to a fully DI-integrated logging configuration.