eng-logging

Guide logging implementation with structured context fields and appropriate log levels.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/CasaPerks/casaflow --skill eng-logging-casaperks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: eng-logging
Source: https://github.com/CasaPerks/casaflow/tree/main/packs/engineering/skills/eng-logging
Command: npx skills add https://github.com/CasaPerks/casaflow --skill eng-logging-casaperks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps engineers implement logging that produces actionable signals for production troubleshooting while avoiding noisy, unsearchable, or sensitive data in logs.

Core Features & Use Cases

  • Log-level discipline: Use error/warn/info/debug appropriately so alerts map to real human investigation needs.
  • Structured logging guidance: Include consistent context fields (like requestId, userId, operation, duration, error) so logs can be searched and correlated.
  • Safety and privacy guardrails: Avoid logging PII, secrets, session identifiers, and sensitive payment/health data, and prefer redaction/masking when necessary.
  • Noise prevention patterns: Don’t log expected 404s as errors, avoid logging every success, and prevent duplicate error logging across layers.

Quick Start

Use the eng-logging Skill when you add or refactor application logging to ensure you select the right log level and include structured context fields.

Frequently Asked Questions about eng-logging

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

FAQPage Schema
How do I implement structured logging with the right log levels for production troubleshooting?

Structured logging requires selecting logger.error, logger.warn, logger.info, or logger.debug by investigation threshold, while emitting consistent context fields like requestId, userId, operation, duration, and error so logs are searchable and correlate to real alerts.

What is the best way to prevent noisy logs and avoid duplicate error logging across application layers?

To prevent noisy logs, avoid logging every success or expected 404s as errors, and eliminate duplicate error logging across different application layers like controllers, middleware, and workers to ensure only actionable signals remain.

How do I redact PII and secrets from application logs in service methods and handlers?

To redact PII and secrets from application logs, avoid logging sensitive payment, health, session identifiers, or personal data entirely, and apply redaction or masking techniques when emitting structured context fields.

When should I use logger.warn vs logger.info vs logger.debug in my application code?

Use logger.error, logger.warn, logger.info, and logger.debug based on the human investigation threshold required, ensuring that alerts mapped to these log levels correspond directly to real operational needs across your code paths.

Does structured logging work for background jobs, retries, and failures in workers and middleware?

Yes, structured logging applies to service methods, controllers, handlers, workers, and middleware by emitting context fields like operation and duration for background jobs, retries, and failures to ensure end-to-end observability.