-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Milestone
Description
Description
The audit found that the codebase uses console.error throughout for error logging. This is not suitable for production and makes error tracking difficult.
Context
Current state:
- console.error used in 30+ API routes
- No log levels (debug, info, warn, error)
- No centralized logging
- No structured logs (JSON)
- Logs remain in production
Requirements
-
Choose Logging Library
- Winston or Pino (recommended: Pino for performance)
- Configure for different environments
-
Implement Logging Utility
- Create
src/lib/logger.ts - Support different log levels
- Structured JSON output
- Environment-based configuration
- Create
-
Replace console.error
- Find all console.error calls
- Replace with logger.error()
- Add context and metadata
-
Production Configuration
- Remove console.* in production
- Configure log levels
- Set up log aggregation (optional)
Acceptance Criteria
- Logging library installed
- Logger utility created
- All console.error replaced
- Log levels configured
- Structured JSON logs in production
- No console.* in production code
Related
- Audit Report: PR Project audit and review #63
- Audit Finding: Error Handling section
Priority
High - Critical for production monitoring
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Todo