logging-best-practices
Skill275 starsChanged 35 days agoApache-2.0View on GitHub
Logging best practices for applications and services including structured logging, log levels, and log management strategies
16 other projects use a version of this.
Adopted by
Most recently taken up by
- theexperiencecompany/gaiatheir own version, first seen Nov 3, 2026
- gilsmt/skillstheir own version, first seen Oct 29, 2026
- anis-dr/skillstheir own version, first seen Oct 15, 2026
- neondatabase/mcp-server-neontheir own version, first seen Oct 8, 2026
- deadlock-mod-manager/deadlock-mod-managertheir own version, first seen Oct 8, 2026
- talhaMah56/claude_skillstheir own version, first seen Sep 12, 2026
Used with
Projects with it also use show-me, improve-codebase-architecture and 6 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
AnasX7Skillshow-me
Help the user understand the current topic visually with concise diagrams, code-shape sketches, and focused HTML artifacts.
Also in 3 projects that use this
GoogleSkillimprove-codebase-architecture
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
Also in 4 projects that use this
CloudflareSkillreceiving-code-review
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
Also in 3 projects that use this
OpenAISkillexecuting-plans
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Also in 3 projects that use this
OpenAISkillrequesting-code-review
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
Also in 3 projects that use this
SentrySkillsecurity-review
Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.
Also in 3 projects that use this
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 16
- neondatabase/mcp-server-neon★ 663same name
- deadlock-mod-manager/deadlock-mod-manager★ 584same name
- theexperiencecompany/gaia★ 325same name
- boristane/agent-skills★ 119same name
- ncklrs/startup-os-skills★ 51same name
- nbbaier/agent-skills★ 14same name
- FaisalAlqarni/sp-ecc★ 9same name
- Stormix/transcripts-mcp★ 8same name
- niieani/caara★ 4same name
- anis-dr/skills★ 3same name
6 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository264 other files it gives its agents.
- accessibility-a11ySkill
- alpine-jsSkill
- analytics-data-analysisSkill
- android-developmentSkill
- angular-developmentSkill
- angularSkill
- anime-jsSkill
- anthropic-claude-developmentSkill
- api-developmentSkill
- apollo-graphqlSkill
- aspnet-coreSkill
- astroSkill
- auth0-authenticationSkill
- autogen-developmentSkill
- automl-hyperparameter-optimizationSkill
- aws-developmentSkill
- azureSkill
- backend-developmentSkill
- bash-scriptingSkill
- beautifulsoup-parsingSkill
- bitbucket-workflowSkill
- blazorSkill
- blender-python-addonSkill
- blockchainSkill
- bootstrapSkill
- business-central-developmentSkill
- cheerio-parsingSkill
- chrome-extension-developmentSkill
- ci-cd-best-practicesSkill
- clean-architectureSkill
- clean-codeSkill
- clerk-authenticationSkill
- cloudflare-developmentSkill
- computer-vision-opencvSkill
- convexSkill
- cppSkill
- c-sharpSkill
- cssSkill
- cypressSkill
- data-analysis-jupyterSkill
- data-analystSkill
- data-jupyter-pythonSkill
- deep-learning-pythonSkill
- deep-learning-pytorchSkill
- deep-learningSkill
- deno-typescriptSkill
- design-systemsSkill
- devopsSkill
- django-pythonSkill
- django-rest-api-developmentSkill
- dockerSkill
- dotnetSkill
- drizzle-ormSkill
- drupal-developmentSkill
- elasticsearch-best-practicesSkill
- electron-developmentSkill
- elixirSkill
- embedded-stm32Skill
- esbuild-bundlerSkill
- ethereumSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 15 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 16 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Use structured logging formats (JSON) for all log output
- Distinctive: line 18
Use a logging library that supports structured output natively
- Distinctive: line 19
Avoid string concatenation for log messages.
- Distinctive: line 36
Use appropriate log levels consistently:
- Distinctive: line 48
Add user context (anonymized) for user-initiated actions
- Distinctive: line 50
Use MDC (Mapped Diagnostic Context) or equivalent for context management
- Distinctive: line 54
Never log sensitive information (passwords, tokens, PII)
- Distinctive: line 57
Consider data retention policies and compliance requirements
- Distinctive: line 62
Use asynchronous logging to avoid blocking application threads
- Distinctive: line 71
Use consistent formatting across all services
- Distinctive: line 81
Avoid duplicate error logging across layers
- Distinctive: line 89
Create actionable log messages that aid debugging
- Distinctive: line 94
Write clear, descriptive messages
- Distinctive: line 96
Avoid generic messages like "Error occurred"
- Distinctive: line 97
Use consistent terminology across the application
“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Logging Best Practices
Apply these logging principles to ensure effective debugging, monitoring, and audit capabilities across applications and services.
Structured Logging
- Use structured logging formats (JSON) for all log output
- Include consistent fields across all log entries
- Make logs machine-parseable while remaining human-readable
- Use a logging library that supports structured output natively
- Avoid string concatenation for log messages; use structured fields
Standard Log Fields
Include these fields in every log entry:
- timestamp: ISO 8601 format with timezone
- level: Log severity (DEBUG, INFO, WARN, ERROR, FATAL)
- message: Human-readable description of the event
- service: Name of the service or application
- version: Application version or build identifier
- trace_id: Distributed tracing correlation ID
- span_id: Current span identifier
- request_id: Unique identifier for the request
Log Levels
Use appropriate log levels consistently:
- DEBUG: Detailed diagnostic information for development
- INFO: Normal operational events and state changes
- WARN: Unexpected situations that are handled gracefully
- ERROR: Failures that affect current operation but not the service
- FATAL: Critical failures requiring immediate attention
Context Propagation
- Include request context in all log entries within a request lifecycle
- Propagate trace IDs across service boundaries
- Add user context (anonymized) for user-initiated actions
- Include relevant business context for domain events
- Use MDC (Mapped Diagnostic Context) or equivalent for context management
Security and Privacy
- Never log sensitive information (passwords, tokens, PII)
- Mask or redact sensitive data when it must be referenced
- Implement log access controls appropriate to data sensitivity
- Consider data retention policies and compliance requirements
- Audit log access for sensitive systems
Performance Considerations
- Use asynchronous logging to avoid blocking application threads
- Implement log sampling for high-volume debug logs in production
- Buffer logs appropriately to balance latency and throughput
- Monitor logging infrastructure for bottlenecks
- Set appropriate log levels per environment
Log Aggregation
- Centralize logs from all services into a single platform
- Use consistent formatting across all services
- Implement log rotation and retention policies
- Enable full-text search and filtering capabilities
- Set up log-based alerts for critical patterns
Error Logging
- Include full error context: message, code, stack trace
- Log the chain of errors in wrapped/nested exceptions
- Include relevant request and state information
- Avoid duplicate error logging across layers
- Log error recovery actions and outcomes
Best Practices
- Log at service boundaries (entry and exit points)
- Include timing information for performance analysis
- Log configuration changes and deployments
- Create actionable log messages that aid debugging
- Review and clean up logging regularly to reduce noise
Log Message Guidelines
- Write clear, descriptive messages
- Include relevant identifiers (user ID, order ID, etc.)
- Avoid generic messages like "Error occurred"
- Use consistent terminology across the application
- Include enough context to understand the event without additional lookups
Environment-Specific Configuration
- Development: DEBUG level, console output, verbose formatting
- Staging: INFO level, structured JSON, full context
- Production: INFO/WARN level, structured JSON, sampling for DEBUG
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

