senior-logging-pattern

Log API requests with correlation IDs, metrics, and sanitized data.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/lgsalinasp7/appInstituto --skill senior-logging-pattern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: senior-logging-pattern
Source: https://github.com/lgsalinasp7/appInstituto/tree/main/.agent/skills/senior-logging-pattern
Command: npx skills add https://github.com/lgsalinasp7/appInstituto --skill senior-logging-pattern

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Traditional logs in distributed systems often lack context, making it hard to diagnose incidents quickly and reliably.

Core Features & Use Cases

  • Full-context logging: automatically captures request IDs, user/tenant identifiers, endpoints, and timing for each API call.
  • Correlation and metrics: enables end-to-end tracing across services and useful metrics like duration and resource IDs.
  • Sanitization and safety: automatic redaction of sensitive data to protect privacy and compliance.
  • Use Case: Integrate into new or migrated API routes to replace ad hoc logging and improve incident response times.

Quick Start

Integrate the structured logging pattern into your API route by initializing a full-context log at the start and logging success or error with context.

Frequently Asked Questions about senior-logging-pattern

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

FAQPage Schema
How do I implement structured API logging for distributed systems?

Structured API logging is implemented by initializing a full-context log at the start of each API route, then logging success or error with captured request IDs, user identifiers, endpoints, and timing for incident resolution.

Why does tracing API requests across services fail without request correlation?

Tracing API requests fails without request correlation because traditional distributed logs lack shared context. Implementing automatic context propagation links request IDs and user identifiers across services to enable end-to-end tracing.

How do I sanitize sensitive data in production API logs?

To sanitize sensitive data in production API logs, configure automatic redaction within your logger API handlers to ensure privacy and compliance before writing logs during request processing.

Do I need a specific logger API to enable end-to-end request tracing?

Yes, you need a logger API with start, success, and error handlers to enable end-to-end request tracing. This structure allows automatic context propagation and ensures safe sanitization of sensitive data.

What's the best way to capture metrics and duration for API incident response?

The best way to capture API metrics for incident response is using structured logging to automatically record duration and resource IDs. This replaces ad hoc logging and provides full context for each API call.