wshaddix avatar

Logging Observability

Handles structured logging, correlation IDs, and health checks for ASP.NET Core Razor Pages apps. Sets up Serilog with multiple sinks (console, Seq), enriches logs with machine name and environment context, and adds middleware to track requests end-to-end with correlation headers. The request logging configuration is smart about log levels, treating slow requests as warnings and 5xx responses as errors. Also covers MediatR pipeline logging if you're using CQRS patterns. The appsettings examples are production-ready, not the usual Hello World stuff. Use this when you're tired of Console.WriteLine and need actual observability before things break in prod.

skills.sh installs
545
GitHub stars
90
last updated
Aug 21, 2026

Install

$ npx -y skills add wshaddix/dotnet-skills --skill logging-observability --agent claude-code

Installs into .claude/skills of the current project.

Files

You are a senior .NET architect specializing in observability. When implementing logging and monitoring in Razor Pages applications, follow these patterns to ensure production-grade observability, troubleshooting capabilities, and integration with monitoring systems. Target .NET 8+ with nullable reference types enabled.

Rationale

Effective observability is critical for production applications. Poor logging makes debugging impossible, and lack of correlation IDs makes tracing requests across services difficult. These patterns provide structured, searchable logs with proper context for troubleshooting.

Core Principles

  1. Structured Logging: Use structured formats (JSON) for machine parsing
  2. Correlation IDs: Every request gets a unique ID for end-to-end tracing
  3. Contextual Enrichment: Logs include relevant context (user, endpoint, duration)
  4. Log Levels: Use appropriate levels (Debug, Info, Warning, Error, Fatal)
  5. External Sinks: Send logs to centralized systems (Seq, Datadog, CloudWatch)

Pattern 1: Serilog Configuration

NuGet Packages

Sponsors

Details

Repository
github.com/wshaddix/dotnet-skills
Categories
DevOps & CI/CD, .NET & C#
First seen
Jun 3, 2026

More from wshaddix/dotnet-skills

All 13
1ahmedasmar avatarci-cdahmedasmar/devops-claude-skillsCI/CD pipeline design, optimization, DevSecOps security scanning, and troubleshooting. Use this skill whenever the user mentions CI/CD, GitHub Actions, GitLab C366skills.sh installs
2fadinglight9291117 avatarharmonyos-build-deployfadinglight9291117/arkts_skillsHarmonyOS application build, clean, package and device installation. Use when building HarmonyOS projects with hvigorw, cleaning build artifacts, managing ohpm 267skills.sh installs
3elastic avatarobservability-k8s-investigationelastic/agent-skills>0skills.sh installs
4forcedotcom avatardx-devops-test-pipeline-configureforcedotcom/sf-skillsConfigures DevOps Center pipeline testing infrastructure: enables a test provider so its suites become available, re-syncs a configured provider to pull in new 5.1Kskills.sh installs
5sickn33 avatarobservability-monitoring-slo-implementsickn33/antigravity-awesome-skillsobservability monitoring slo implement227skills.sh installs
6akin-ozer avatark8s-yaml-validatorakin-ozer/cc-devops-skillsValidate, lint, audit, or dry-run Kubernetes manifests (Deployment, Service, ConfigMap, CRD).715skills.sh installs