From aj-geddes-useful-ai-prompts-4
Implements structured JSON logging with log levels (DEBUG/INFO/WARN/ERROR), contextual info, PII redaction, performance logging, and centralized logging. Use for observability, debugging, and production setup.
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)
references/centralized-logging.mdreferences/contextual-logging.mdreferences/distributed-tracing.mdreferences/log-levels.mdreferences/log-sampling-high-volume-services.mdreferences/performance-logging.mdreferences/pii-and-sensitive-data-handling.mdreferences/structured-logging-json.mdscripts/health-check.shtemplates/dashboard-config.yamlSearches, 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`.
Comprehensive guide to implementing structured, secure, and performant logging across applications. Covers log levels, structured logging formats, contextual information, PII protection, and centralized logging systems.
Minimal working example:
// logger.ts
enum LogLevel {
DEBUG = 0, // Detailed information for debugging
INFO = 1, // General informational messages
WARN = 2, // Warning messages, potentially harmful
ERROR = 3, // Error messages, application can continue
FATAL = 4, // Critical errors, application must stop
}
class Logger {
constructor(private minLevel: LogLevel = LogLevel.INFO) {}
debug(message: string, context?: object) {
if (this.minLevel <= LogLevel.DEBUG) {
this.log(LogLevel.DEBUG, message, context);
}
}
info(message: string, context?: object) {
if (this.minLevel <= LogLevel.INFO) {
this.log(LogLevel.INFO, message, context);
}
}
warn(message: string, context?: object) {
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Log Levels | Log Levels |
| Structured Logging (JSON) | Structured Logging (JSON) |
| Contextual Logging | Contextual Logging |
| PII and Sensitive Data Handling | PII and Sensitive Data Handling |
| Performance Logging | Performance Logging |
| Centralized Logging | Centralized Logging |
| Distributed Tracing | Distributed Tracing |
| Log Sampling (High-Volume Services) | Log Sampling (High-Volume Services) |