Skip to main content
skill CX Codex

application-logging — Claude Code skill: structured logs and ELK

A skill that walks your agent through structured logging: levels, context, request tracing and centralized aggregation.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add aj-geddes/useful-ai-prompts --skill application-logging -a claude-code
Open on GitHub

What application-logging does

The skill gives your agent a procedure for adding structured logging to an application: JSON output, sensible levels, context attached to error messages, request IDs for tracing. It ships a short working winston logger example for Node.js plus reference guides in the references/ directory covering Node.js and Python logging, Express HTTP request logging, Flask integration, ELK stack setup and Logstash configuration.

Reach for it when something misbehaves in production and the logs don't tell you why, or when logs exist but sit in one flat file with no structure. The skill also spells out hygiene rules: keep passwords and secrets out of logs, don't log every operation at INFO, don't let log files grow without a bound. One piece of advice is worth a second look — it says not to log to stdout in production, yet containers and Kubernetes collect logs from stdout in the first place.

The reference material targets Node.js and Python, so other stacks get the general guidance only. Install runs through npx skills add for Claude, Codex, Cursor, Gemini CLI and OpenCode; GitHub Copilot uses gh skill install.

What it helps with

  • split application logs into levels and structure instead of flat lines
  • attach request IDs so a request can be traced across services
  • stand up an ELK stack and write a Logstash config for your logs
  • set up log rotation so files don't grow without a bound
  • strip passwords and secrets out of what gets logged

Example prompts for the agent

  • set up structured logging with winston in my Node.js service
  • add request IDs to the Express logs and keep tokens out of them
  • help me deploy the ELK stack and write a Logstash config for our logs

How to install application-logging

1Skills CLI (Vercel)

npx skills add aj-geddes/useful-ai-prompts --skill application-logging -a claude-code

2Manually: put the files in place

~/.claude/skills/application-logging/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/application-logging/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about application-logging

How do I install application-logging in Claude?

Run npx skills add aj-geddes/useful-ai-prompts --skill application-logging -a claude-code. The skill file then lands at ~/.claude/skills/application-logging/SKILL.md.

What does application-logging do?

It guides your agent through structured logging: JSON format, levels, error context, request IDs. It also bundles reference guides for Node.js, Python, Express, Flask and the ELK stack.

Which languages have ready-made examples?

The guides under references/ cover Node.js and Python, including Express HTTP request logging and Flask integration. Other languages get the general rules only.

Source text

SKILL.md · MIT
---
name: application-logging
description: >
  Implement structured logging across applications with log aggregation and
  centralized analysis. Use when setting up application logging, implementing
  ELK stack, or analyzing application behavior.
---

# Application Logging

## Table of Contents

- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)

## Overview

Implement comprehensive structured logging with proper levels, context, and centralized aggregation for effective debugging and monitoring.

## When to Use

- Application debugging
- Audit trail creation
- Performance analysis
- Compliance requirements
- Centralized log aggregation

## Quick Start

Minimal working example:

```javascript
// logger.js
const winston = require("winston");

const logFormat = winston.format.combine(
  winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }),
  winston.format.errors({ stack: true }),
  winston.format.json(),
);

const logger = winston.createLogger({
  level: process.env.LOG_LEVEL || "info",
  format: logFormat,
  defaultMeta: {
    service: "api-service",
    environment: process.env.NODE_ENV || "development",
  },
  transports: [
    new winston.transports.Console({
      format: winston.format.combine(
        winston.format.colorize(),
        winston.format.simple(),
      ),
    }),
    new winston.transports.File({
      filename: "logs/error.log",
// ... (see reference guides for full implementation)
```

## Reference Guides

Detailed implementations in the `references/` directory:

| Guide | Contents |
|---|---|
| [Node.js Structured Logging with Winston](references/nodejs-structured-logging-with-winston.md) | Node.js Structured Logging with Winston |
| [Express HTTP Request Logging](references/express-http-request-logging.md) | Express HTTP Request Logging |
| [Python Structured Logging](references/python-structured-logging.md) | Python Structured Logging |
| [Flask Integration](references/flask-integration.md) | Flask Integration |
| [ELK Stack Setup](references/elk-stack-setup.md) | ELK Stack Setup |
| [Logstash Configuration](references/logstash-configuration.md) | Logstash Configuration |

## Best Practices

### ✅ DO

- Use structured JSON logging
- Include request IDs for tracing
- Log at appropriate levels
- Add context to error logs
- Implement log rotation
- Use timestamps consistently
- Aggregate logs centrally
- Filter sensitive data

### ❌ DON'T

- Log passwords or secrets
- Log at INFO for every operation
- Use unstructured messages
- Ignore log storage limits
- Skip context information
- Log to stdout in production
- Create unbounded log files

© aj-geddes · MIT · aj-geddes/useful-ai-prompts

Similar skills

Everything for DevOps and infrastructure →

From the same set118

Computer Vision A skill for computer vision work: image classification, object detection, segmentation and pose estimation with PyTorch and TensorFlow. CX Codex +1 499installs cicd-pipeline-setup A skill that walks your agent through building a CI/CD pipeline: tests, artifact builds, security checks and deploys across environments. CX Codex +1 498installs test-automation-framework A skill for designing a test automation framework: Page Object Model, fixtures, reporting and test organization. Useful once a suite grows and needs a shared shape. CX Codex +1 498installs stress-testing A skill for stress testing: push a system past normal capacity to find breaking points, check auto-scaling and recovery after overload. CX Codex +1 497installs changelog-maintenance A skill that gets your agent to write and maintain CHANGELOG.md in Keep a Changelog format, with Added, Changed, Fixed and Security sections. CX Codex +1 495installs grafana-dashboard Lets your agent write Grafana dashboards: panels, template variables, alerts and provisioning. Handy when you need monitoring up before the next deploy. CX Codex +1 494installs Model Hyperparameter Tuning A skill for tuning model hyperparameters: grid search, random search, Bayesian optimization with Optuna. Useful once baseline settings stop improving. CX Codex +1 494installs api-reference-documentation A skill that walks the agent through writing API reference docs: endpoints, auth, request and response examples, OpenAPI specs. CX Codex +1 494installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor