toolcacheAI Coding Prompts › Error Handling & Logging Framework

Error Handling & Logging Framework

💻 Coding✓ Essential
Design a comprehensive error handling and logging framework for [APPLICATION] built with [LANGUAGE/FRAMEWORK].

Provide:
1. **Error Hierarchy**: Custom error classes with codes, messages, and HTTP status mappings
2. **Global Error Handler**: Middleware that catches all unhandled errors
3. **Structured Logging**: Log format (JSON), log levels, what to log at each level
4. **Request Logging**: Middleware that logs every request with timing and correlation ID
5. **Sensitive Data Redaction**: How to prevent logging passwords, tokens, PII
6. **Error Response Format**: Consistent API error responses (production vs development)
7. **Client-Side Error Tracking**: How to capture and report frontend errors
8. **Alerting Rules**: Which errors trigger alerts and how
9. **Log Rotation & Retention**: Configuration for production
10. **Implementation Code**: Full working code for all of the above
🔒

Unlock this prompt

You have 5 free unlocks remaining

or
Get unlimited access from £2.99 →

How to use this prompt

Copy the prompt above and paste it into ChatGPT, Claude, Gemini, or any AI assistant. Replace the bracketed placeholders with your specific details.

Leave a Review

Tried this prompt? Let us know how it worked — your reviews help other users find the best prompts.

Get Unlimited Access →Browse All 2,400 Prompts