structured-logging

Enforce JSON-structured logging with correlation IDs and log levels.

1|Updated Sep 14, 2025
One-click install
npx skills add https://github.com/CleanExpo/DR-NRPG --skill structured-logging-cleanexpo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: structured-logging
Source: https://github.com/CleanExpo/DR-NRPG/tree/main/.skills/custom/structured-logging
Command: npx skills add https://github.com/CleanExpo/DR-NRPG --skill structured-logging-cleanexpo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures that logs generated by both your backend and frontend applications are consistent, machine-readable, and contain essential contextual information for effective debugging and monitoring.

Core Features & Use Cases

  • JSON Structured Logging: Enforces JSON output for logs, making them easily parseable by log aggregation tools.
  • Correlation IDs: Automatically generates and propagates correlation IDs to trace requests across different services.
  • Log Levels: Standardizes the use of ERROR, WARNING, INFO, and DEBUG levels for clear communication of event severity.
  • Sensitive Data Redaction: Provides guidelines to prevent logging of sensitive information like passwords and API keys.
  • Use Case: When a user reports an issue, you can use the correlation ID from their interaction to find all related logs from both the frontend and backend, pinpointing the exact cause of the problem quickly.

Quick Start

Implement the structured logging skill by adding the CorrelationIdMiddleware to your FastAPI application.

Frequently Asked Questions about structured-logging

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

FAQPage Schema
How do I implement JSON structured logging with correlation IDs in FastAPI?

To implement JSON structured logging with correlation IDs in FastAPI, add the CorrelationIdMiddleware to your application. This enforces machine-readable JSON output and automatically propagates correlation IDs to trace requests across services.

Why do I need correlation IDs for frontend and backend observability?

Correlation IDs are needed for frontend and backend observability to trace a single user interaction across your full stack. By propagating this unique identifier, you can pinpoint related logs from both the frontend Logger class and backend structlog instances to quickly find an issue's exact cause.

What is the best way to standardize log levels for full stack request tracing?

The best way to standardize log levels for full stack request tracing is to enforce consistent ERROR, WARNING, INFO, and DEBUG severities across both frontend and backend applications. This ensures clear communication of event severity during debugging and monitoring.

How does sensitive data redaction work with JSON structured logging?

Sensitive data redaction in JSON structured logging works by providing specific middleware and logger configuration guidelines that prevent logging confidential information like passwords and API keys. This ensures consistent output and safe data handling across your stack.

Can I use structlog for backend debugging alongside a frontend Logger class?

Yes, you can use structlog for backend debugging alongside a frontend Logger class. This combination enforces JSON-structured logging with contextual metadata, facilitating consistent observability and effective debugging across your full stack.