structured-logging

Define and enforce a JSON log schema with correlation identifiers across services.

Updated Mar 29, 2026
One-click install
npx skills add https://github.com/marquesfelip/agents-and-skills --skill structured-logging-marquesfelip
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: structured-logging
Source: https://github.com/marquesfelip/agents-and-skills/tree/main/skills/structured-logging
Command: npx skills add https://github.com/marquesfelip/agents-and-skills --skill structured-logging-marquesfelip

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Structured logging practices ensure consistent, machine-readable logs that improve observability, debugging, and security across services.

Core Features & Use Cases

  • Define a standard JSON log schema with mandatory fields (time, level, msg, service, version, env, trace_id, span_id, request_id)
  • Enforce correlation identifiers propagation across HTTP boundaries, message queues, and background jobs
  • Implement log-level controls, sampling, and sensitive data masking to prevent data leakage
  • Use cases include microservices observability, incident response, and audit trails

Quick Start

Instrument your services to emit JSON logs to stdout with per-request correlation identifiers.

Frequently Asked Questions about structured-logging

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

FAQPage Schema
How do I implement structured logging with correlation IDs across microservices?

Structured logging is enforced by defining a standard JSON schema with mandatory fields like time, level, msg, service, and trace_id. This ensures consistent, machine-readable logs that improve observability, debugging, and security across distributed services.

How do I propagate trace context through message queues and background jobs?

Trace context propagation involves passing correlation identifiers like trace_id and span_id across HTTP boundaries, message queues, and background jobs. This ensures that related log events can be linked together for incident response and debugging across services.

What is the best way to mask sensitive data in JSON application logs?

Sensitive data masking in logs is handled by implementing masking policies that redact or hash protected fields before output. This prevents data leakage while maintaining useful audit trails and observability for incident response and debugging purposes.

How do I configure log sampling rules to reduce observability data volume?

Log sampling rules are configured to selectively drop or retain log events based on criteria like level or trace_id. This reduces data volume and storage costs while maintaining necessary observability for audit trails and incident response.

Does structured logging require a specific framework to work with HTTP and messaging boundaries?

Structured logging does not require a specific framework, as it defines a standard JSON log schema with mandatory fields. You instrument your services to emit JSON logs to stdout with per-request correlation identifiers, independent of specific frameworks.