From aj-geddes-useful-ai-prompts-4
Implements structured logging in Node.js/Express with Winston, Python/Flask, and ELK stack setup for centralized aggregation, analysis, and app debugging.
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin aj-geddes-useful-ai-prompts-4This skill uses the workspace's default tool permissions.
- [Overview](#overview)
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Implement comprehensive structured logging with proper levels, context, and centralized aggregation for effective debugging and monitoring.
Minimal working example:
// 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)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Node.js Structured Logging with Winston | Node.js Structured Logging with Winston |
| Express HTTP Request Logging | Express HTTP Request Logging |
| Python Structured Logging | Python Structured Logging |
| Flask Integration | Flask Integration |
| ELK Stack Setup | ELK Stack Setup |
| Logstash Configuration | Logstash Configuration |