One-click install
npx skills add https://github.com/Resgrid/Core --skill serilog-resgrid
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: serilog
Source: https://github.com/Resgrid/Core/tree/main/.opencode/skills/serilog
Command: npx skills add https://github.com/Resgrid/Core --skill serilog-resgrid

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid unstructured, hard-to-debug logging by setting up Serilog so every log event carries consistent, queryable structure from startup through request handling.

Core Features & Use Cases

  • Two-stage initialization: Capture startup failures with a bootstrap logger, then switch to the fully configured logger once DI is ready.
  • DI-first configuration: Use AddSerilog() with ReadFrom.Services and appsettings.json-driven configuration for environment-specific log levels, sinks, and overrides.
  • Rich request logging: Add a single, configurable request summary using Serilog request logging to reduce noise while still capturing status, timing, and diagnostic context.
  • Structured messages and destructuring: Log using message templates and control destructuring depth/size to keep logs accurate and safe to store.

Quick Start

Use the serilog skill to configure your appsettings.json and then add Serilog via AddSerilog() with request logging enabled so your application emits structured events with consistent properties.

Frequently Asked Questions about serilog

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

FAQPage Schema
How do I configure structured logging in ASP.NET Core with Serilog?

Configure Serilog in ASP.NET Core by using AddSerilog() with DI integration and appsettings.json-driven settings to produce structured, queryable log events with consistent properties across your application.

Why do I need a bootstrap logger for Serilog startup diagnostics?

A bootstrap logger captures startup failures before dependency injection is ready, then switches to the fully configured logger once DI is available, ensuring no early errors are lost.

How do I reduce noise from HTTP request logging in Serilog?

Add Serilog request logging middleware to emit a single, configurable request summary that captures status, timing, and diagnostic context while reducing repetitive per-request log noise.

How do I control destructuring depth and size in Serilog message templates?

Use Serilog destructuring controls within message templates to limit depth and size, keeping structured logs accurate and safe to store when logging complex objects.

Can I configure Serilog sinks and enrichers through appsettings.json?

Yes, Serilog supports appsettings.json-driven configuration for environment-specific log levels, sinks, and enrichers by using ReadFrom.Services with AddSerilog() during DI setup.

What is the best way to capture .NET 10 startup failures with structured logging?

Use Serilog's two-stage bootstrap initialization to capture startup diagnostics with a temporary logger, then transition to the configured logger once the application pipeline is ready.