logging-best-practices
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
More from mindrally/skills
fastapi-python
Expert in FastAPI Python development with best practices for APIs and async operations
8.6Knextjs-react-typescript
Expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind
2.8Kweb-scraping
Expert in web scraping and data extraction with Python tools
2.3Kcomputer-vision-opencv
Expert guidance for computer vision development using OpenCV, PyTorch, and modern deep learning techniques for image and video processing.
1.9Kaccessibility-a11y
Implement web accessibility (a11y) best practices following WCAG guidelines to create inclusive, accessible user interfaces.
1.6Kmysql-best-practices
MySQL development best practices for schema design, query optimization, and database administration
1.6K