wide-event-logging

Aggregate per-request events into a single JSON log for Spring Boot applications.

Updated Jan 23, 2025
One-click install
npx skills add https://github.com/ymkz/demo-monorepo --skill wide-event-logging
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: wide-event-logging
Source: https://github.com/ymkz/demo-monorepo/tree/main/.agents/skills/wide-event-logging
Command: npx skills add https://github.com/ymkz/demo-monorepo --skill wide-event-logging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This project aggregates all events generated during a single request into a unified JSON log, improving traceability, observability, and performance analysis across the processing pipeline.

Core Features & Use Cases

  • Unified event collection across Controller, Usecase, Domain, and Infrastructure into one structured log
  • MDC/ThreadLocal-based request binding enabling efficient per-request tracing
  • Structured log output that integrates with log aggregation platforms for analytics

Quick Start

Start the wide-event-logging integration in a Spring Boot project and ensure a per-request ID is captured and attached to all logs.

Frequently Asked Questions about wide-event-logging

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

FAQPage Schema
How do I aggregate all Spring Boot request events into a single JSON log?▼

Wide-event-logging aggregates Spring Boot request events into a single JSON log by binding a per-request identifier using MDC and ThreadLocal, collecting events across controllers and domain logic, then outputting the final structured log with cleanup.

What is wide event logging and when do I need it for traceability?▼

Wide event logging is the collection of all events generated during a single request into a unified JSON log. You need it to improve traceability and performance analysis across the entire processing pipeline in Spring Boot applications.

How do I trace a single request across controller, use case, and infrastructure layers?▼

To trace a single request across layers, you capture and attach a per-request ID using MDC and ThreadLocal, enabling the aggregation of events from the controller, use case, domain, and infrastructure into one structured log.

Does this request event aggregation approach require MDC or ThreadLocal setup?▼

Yes, this approach requires MDC and ThreadLocal usage to bind per-request identifiers, ensuring all events during the request lifecycle are correctly tracked and aggregated before final JSON output and cleanup.

What's the best way to output structured JSON logs for log aggregation platforms in Spring Boot?▼

The best way to output structured JSON logs for aggregation platforms is to collect all per-request events across your Spring Boot application layers and aggregate them into a single unified JSON log entry.

Why does MDC ThreadLocal cleanup matter when aggregating request logs?▼

MDC ThreadLocal cleanup matters because failing to clear per-request identifiers after outputting the aggregated JSON log can cause memory leaks and cross-request data contamination in Spring Boot applications.