code-logging

Standardize TypeScript production logging with pino and PostHog.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/jjmendezrodriguez/jm-claude-plugin --skill code-logging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-logging
Source: https://github.com/jjmendezrodriguez/jm-claude-plugin/tree/main/skills/code-logging
Command: npx skills add https://github.com/jjmendezrodriguez/jm-claude-plugin --skill code-logging

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents production debugging from turning into guesswork by standardizing structured logging, log levels, redaction, and request correlation across TypeScript services and browser analytics.

Core Features & Use Cases

  • Event-name-first structured logging: Log searchable domain events with context objects for consistent filtering and analytics.
  • Sensitive data protection: Redact secrets and avoid logging PII (emails, tokens, passwords, SSNs) to reduce breach risk.
  • Request correlation with requestId: Use logger.child() to propagate a shared requestId through request lifecycles.
  • Cross-platform observability: Pair server-side pino logs with PostHog capture and safe Edge Function shipping patterns.
  • Log level discipline: Use trace/debug/info/warn/error/fatal with clear paging guidance and operational intent.

Quick Start

Use the code-logging skill to tell the AI how to replace your console logging with pino event-name-first logs, add requestId correlation via logger.child, and configure redaction and PostHog session replay masking for your app.

Frequently Asked Questions about code-logging

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

FAQPage Schema
How do I implement structured logging in TypeScript with pino?

Structured logging in TypeScript with pino uses event-name-first payloads and context objects for consistent filtering. You configure log levels and request-scoped logger propagation using logger.child to maintain searchable domain events across service lifecycles.

How does request correlation work with requestId and logger.child?

Request correlation uses logger.child() to propagate a shared requestId through request lifecycles in TypeScript services. This links related logs across endpoints and handlers, ensuring debugging remains reliable when tracing distributed operations.

What's the best way to redact sensitive data and PII in production logs?

Redacting sensitive data in production logs requires strict filtering of fields like emails, tokens, passwords, and SSNs. This reduces breach risk by preventing PII exposure while retaining structured event context for observability and analytics.

Can I use pino logging with PostHog for browser analytics observability?

Pino logging integrates with PostHog to pair server-side logs with browser analytics and session replay masking. This cross-platform observability approach captures context, durations, and correlation across requests without leaking secrets.

Does this logging approach work for Edge Functions in TypeScript?

This structured logging approach applies to Edge Functions in TypeScript by enforcing safe shipping patterns. It captures context and durations while maintaining strict redaction and consistent log levels for reliable production observability.

When do I need different log levels like trace debug info warn error fatal?

Log levels from trace to fatal provide clear paging guidance and operational intent. Use trace and debug for development diagnostics, info for standard operations, and warn through fatal for escalating issues requiring immediate operational attention.