home / skills / williamzujkowski / standards / logging
This skill helps you implement secure, well-documented logging patterns for observability in Python applications, improving reliability and debugging
npx playbooks add skill williamzujkowski/standards --skill loggingReview the files below or copy the command above to add this skill to your agents.
---
name: logging
description: Logging standards for logging in Observability environments. Covers best
---
# Logging
> **Quick Navigation:**
> Level 1: [Quick Start](#level-1-quick-start) (5 min) → Level 2: [Implementation](#level-2-implementation) (30 min) → Level 3: [Mastery](#level-3-mastery-resources) (Extended)
---
## Level 1: Quick Start
### Core Principles
1. **Best Practices**: Follow industry-standard patterns for observability
2. **Security First**: Implement secure defaults and validate all inputs
3. **Maintainability**: Write clean, documented, testable code
4. **Performance**: Optimize for common use cases
### Essential Checklist
- [ ] Follow established patterns for observability
- [ ] Implement proper error handling
- [ ] Add comprehensive logging
- [ ] Write unit and integration tests
- [ ] Document public interfaces
### Quick Links to Level 2
- [Core Concepts](#core-concepts)
- [Implementation Patterns](#implementation-patterns)
- [Common Pitfalls](#common-pitfalls)
---
## Level 2: Implementation
### Core Concepts
This skill covers essential practices for observability.
**Key areas include:**
- Architecture patterns
- Implementation best practices
- Testing strategies
- Performance optimization
### Implementation Patterns
Apply these patterns when working with observability:
1. **Pattern Selection**: Choose appropriate patterns for your use case
2. **Error Handling**: Implement comprehensive error recovery
3. **Monitoring**: Add observability hooks for production
### Common Pitfalls
Avoid these common mistakes:
- Skipping validation of inputs
- Ignoring edge cases
- Missing test coverage
- Poor documentation
---
## Level 3: Mastery Resources
### Reference Materials
- [Related Standards](../../docs/standards/)
- [Best Practices Guide](../../docs/guides/)
### Templates
See the `templates/` directory for starter configurations.
### External Resources
Consult official documentation and community best practices for observability.
This skill defines logging standards for observability environments to make services diagnosable, secure, and performant. It gives concise guidance on what to log, how to structure logs, and how to integrate logs with monitoring and alerting. The goal is consistent, actionable logs across projects so teams can troubleshoot and measure behavior quickly.
The skill inspects logging needs across layers (application, middleware, and integrations) and prescribes patterns for message structure, severity levels, and context propagation. It recommends secure defaults (no secrets in logs), standard formats (JSON with stable fields), and hooks for exporting logs to observability backends. It also outlines testing and performance considerations to prevent logging from becoming a reliability bottleneck.
Should I use JSON or plain text for logs?
Prefer structured JSON because it enables reliable parsing, indexing, and querying in observability backends; reserve plain text for local debugging only.
How do I avoid logging sensitive data?
Adopt a deny-by-default approach: sanitize known sensitive fields, enforce field allowlists, and run automated scans on logs and configs.