logging

Configure Serilog structured logging for .NET applications with sinks, enrichment, and correlation IDs.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/congiuluc/my-awesome-copilot --skill logging-congiuluc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logging
Source: https://github.com/congiuluc/my-awesome-copilot/tree/main/skills/logging
Command: npx skills add https://github.com/congiuluc/my-awesome-copilot --skill logging-congiuluc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Configure structured logging in .NET apps with Serilog to enable sink configuration, enrichment, correlation IDs, log level control, and filtering of sensitive data.

Core Features & Use Cases

  • Bootstrap Configuration: configure Serilog on host startup with sinks and enrichment.
  • Correlation Middleware: add and propagate correlation IDs across requests.
  • Sensitive Data Filtering: enforce masking and safe logging practices.
  • Request Logging Middleware: log HTTP requests with contextual data.

Quick Start

Configure Serilog on startup to enable structured logging with sinks, enrichment, and correlation IDs.

Frequently Asked Questions about logging

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

FAQPage Schema
How do I configure structured logging in .NET using Serilog?

Configure structured logging in .NET using Serilog by setting up bootstrap configuration on host startup to define sinks, apply enrichment, and establish log level controls across web APIs and background services.

How do I propagate correlation IDs across requests in .NET web APIs?

Propagate correlation IDs across requests in .NET web APIs by implementing correlation middleware that assigns and flows the unique identifier through the diagnostic context for distributed request tracing.

How do I filter sensitive data from Serilog logs in .NET?

Filter sensitive data from Serilog logs in .NET by enforcing masking and safe logging practices that inspect log events and redact protected fields before they reach configured sinks.

Can I use Serilog structured logging for microservices and background services?

Yes, you can apply Serilog structured logging for microservices and background services by configuring sinks, enrichment, and correlation IDs that maintain consistent diagnostic contexts across distributed application components.

What is the best way to log HTTP requests with contextual data in .NET?

Log HTTP requests with contextual data in .NET by using request-logging middleware that captures contextual information and integrates it into the structured logging pipeline during host startup configuration.

Does Serilog support bootstrap configuration for .NET host startup?

Yes, Serilog supports bootstrap configuration for .NET host startup by initializing sinks, enrichment, and log levels during application initialization to enable structured logging immediately upon service launch.