logging-standardslisted
Install: claude install-skill komluk/scaffolding
# Logging Standards Skill
## Purpose
Standards for consistent, useful logging across all application layers.
## Auto-Invoke Triggers
- Adding log statements
- Configuring logging infrastructure
- Debugging issues
- Setting up monitoring
---
## Log Levels
| Level | Use Case | Example |
|-------|----------|---------|
| **TRACE** | Detailed debugging | Variable values, loop iterations |
| **DEBUG** | Diagnostic info | Method entry/exit, state changes |
| **INFO** | Normal operations | Request completed, job started |
| **WARN** | Potential issues | Retry attempt, deprecated usage |
| **ERROR** | Failures | Exception caught, operation failed |
| **FATAL** | System failure | Cannot start, out of memory |
### Level Selection Rules
- Production default: INFO
- Development default: DEBUG
- Never log TRACE in production
- ERROR should always have context
---
## Log Message Format
### Structure
```
[timestamp] [level] [correlation-id] [logger] - message {structured-data}
```
### Example
```
2024-01-15T10:30:45.123Z INFO abc-123-def UserService - User created {"userId": 42, "email": "user@example.com"}
```
### Message Guidelines
- Start with action verb: "Creating user", "Processing order"
- Be specific: "User 123 deleted" not "Deleted"
- Include relevant IDs
- Keep messages concise
---
## Structured Logging
### Required Fields
| Field | Description | Example |
|-------|-------------|---------|
| timestamp | ISO 8601 format | 2024-01-15T10:30:45.123Z |
| level | Log level