Logging Best Practices
Ensures consistent, high-quality logging across systems following mindrally's established best practices for improved debugging and analysis.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add mindrally-logging-best-practices npx -- -y @trustedskills/mindrally-logging-best-practices
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"mindrally-logging-best-practices": {
"command": "npx",
"args": [
"-y",
"@trustedskills/mindrally-logging-best-practices"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill ensures consistent, high-quality logging across applications and services by enforcing mindrally's established best practices. It focuses on structured logging using JSON format with specific fields for debugging, monitoring, and auditing purposes. The goal is to create machine-parseable logs that remain human-readable, improving overall system observability.
When to use it
- When implementing new applications or services where consistent logging standards are required.
- During refactoring efforts to standardize existing log formats across a codebase.
- To improve debugging and troubleshooting capabilities by ensuring complete and structured error information is captured.
- When integrating multiple microservices that need correlated tracing.
- For compliance purposes, requiring detailed audit trails of system activity.
Key capabilities
- Structured Logging: Enforces JSON formatted log output.
- Standardized Fields: Requires consistent fields like timestamp, level, message, service, version, trace_id, span_id, request_id.
- Log Level Guidance: Provides recommendations for appropriate use of DEBUG, INFO, WARN, ERROR, and FATAL levels.
- Context Propagation: Promotes including request context (trace IDs, user context, business context) in log entries.
- Security & Privacy: Emphasizes avoiding sensitive data logging and implementing access controls.
- Performance Optimization: Suggests asynchronous logging, sampling, buffering, and monitoring.
- Log Aggregation: Encourages centralizing logs with consistent formatting and search capabilities.
Example prompts
- "Apply the Logging Best Practices to this new service."
- "Ensure all log entries include a trace_id for request correlation."
- "Review these existing log messages and suggest improvements based on mindrally's guidelines."
Tips & gotchas
- Requires using a logging library that natively supports structured output (JSON).
- Be mindful of sensitive data; avoid logging passwords, tokens, or PII. Mask or redact when necessary.
- Consistent implementation across all services is crucial for effective log aggregation and analysis.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.