logging-best-practices

Implement structured logging with JSON formats and standard log levels.

1|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/tense-i/tslink --skill logging-best-practices-tense-i
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: logging-best-practices
Source: https://github.com/tense-i/tslink/tree/main/skills/logging-best-practices
Command: npx skills add https://github.com/tense-i/tslink --skill logging-best-practices-tense-i

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to implementing effective logging strategies, ensuring your applications are observable, maintainable, and secure.

Core Features & Use Cases

  • Structured Logging: Implement JSON-formatted logs for easier parsing and analysis.
  • Log Levels: Utilize DEBUG, INFO, WARN, ERROR, FATAL for granular control over log verbosity.
  • Contextual Logging: Enrich logs with request IDs, user IDs, and other relevant context.
  • PII Handling: Securely manage sensitive data in logs through redaction and masking.
  • Centralized Logging: Integrate with systems like ELK or CloudWatch for unified log management.
  • Use Case: When debugging a production issue, you can use this Skill to understand the flow of a request by examining structured logs that include correlation IDs and user context, helping you pinpoint the root cause quickly.

Quick Start

Implement structured logging with JSON formats and standard log levels using the provided Node.js Winston example.

Frequently Asked Questions about logging-best-practices

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

FAQPage Schema
How do I implement structured logging in Node.js, Python, or Go?

Structured logging captures JSON-formatted application events with contextual metadata like request IDs and user IDs, enabling you to trace distributed request flows and pinpoint root causes during debugging.

What is the best way to handle PII in application logs?

Handle PII in logs by applying redaction and masking techniques to sensitive data fields before sending them to centralized logging systems, ensuring your application remains secure and compliant.

How do I set up centralized logging with ELK or CloudWatch?

Set up centralized logging by integrating your structured log outputs with systems like ELK or CloudWatch, providing a unified interface to query and analyze application behavior across services.

Does this Skill support distributed tracing with Jaeger?

Yes, it supports distributed tracing with Jaeger by correlating trace IDs with contextual logs, allowing you to examine request flows across microservices and identify performance bottlenecks.

How do I manage log verbosity and performance in high-volume services?

Manage log verbosity using DEBUG, INFO, WARN, ERROR, and FATAL levels, and apply log sampling techniques in high-volume services to reduce performance overhead and storage costs.