boristane avatar

Logging Best Practices

The logging-best-practices skill provides guidelines for implementing effective logging through "wide events" (canonical log lines)—a pattern where developers emit a single, context-rich structured event per request per service rather than scattering multiple log lines throughout code. It's designed for developers writing or reviewing logging code, designing logging strategies for new services, and setting up logging infrastructure. The skill solves the problem of fragmented, difficult-to-debug logs by consolidating request context (business metrics, environment details, performance data, and error information) into queryable structured events that enable powerful debugging and analytics.

skills.sh installs
5K
GitHub stars
127
last updated
Jul 14, 2026

Install

$ npx -y skills add boristane/agent-skills --skill logging-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Files

Logging Best Practices Skill

Version: 1.0.0

Purpose

This skill provides guidelines for implementing effective logging in applications. It focuses on wide events (also called canonical log lines) - a pattern where you emit a single, context-rich event per request per service, enabling powerful debugging and analytics.

When to Apply

Apply these guidelines when:

  • Writing or reviewing logging code
  • Adding console.log, logger.info, or similar
  • Designing logging strategy for new services
  • Setting up logging infrastructure

Core Principles

1. Wide Events (CRITICAL)

Emit one context-rich event per request per service. Instead of scattering log lines throughout your handler, consolidate everything into a single structured event emitted at request completion.

const wideEvent: Record<string, unknown> = {
  method: 'POST',
  path: '/checkout',
  requestId: c.get('requestId'),
  timestamp: new Date().toISOString(),
};

try {
  const user = await getUser(c.get('userId'));
  wideEvent.user = { id: user.id, subscription: user.subscription };

Sponsors

Details

Repository
github.com/boristane/agent-skills
Categories
DevOps & CI/CD, AI & Agent Building
1affaan-m avatarkubernetes-patternsaffaan-m/eccKubernetes workload patterns, resource management, RBAC, probes, autoscaling, ConfigMap/Secret handling, and kubectl debugging for production-grade deployments.4.9Kskills.sh installs
2affaan-m avatarorch-build-mvpaffaan-m/eccOrchestrate bootstrapping a working MVP from a design or spec document — ingest the doc, plan thin vertical slices, scaffold the first end-to-end slice, then TD4.8Kskills.sh installs
3claude-office-skills avatardoc-pipelineclaude-office-skills/skillsChain document operations into reusable pipelines4.7Kskills.sh installs
4affaan-m avatarralphinho-rfc-pipelineaffaan-m/everything-claude-coderalphinho rfc pipeline4.7Kskills.sh installs
5wshobson avatarrecsys-pipeline-architectwshobson/agentsDesign composable recommendation, ranking, and feed pipelines using the six-stage Source→Hydrator→Filter→Scorer→Selector→SideEffect framework popularized by xAI4.6Kskills.sh installs
6dotnet avatardirectory-build-organizationdotnet/skillsGuide for organizing MSBuild infrastructure with Directory.Build.props, Directory.Build.targets, Directory.Packages.props, and Directory.Build.rsp. USE FOR: str4.5Kskills.sh installs