Added production-ready logging using Pino with structured JSON output,
pretty printing in development, and automatic sensitive data redaction.
## Phase 1: Core Logger Setup
- Installed pino, pino-http, and pino-pretty dependencies
- Created logger utility (lib/utils/logger.ts):
- Environment-based log levels (debug in dev, info in prod)
- Pretty printing with colors in development
- JSON structured logs in production
- Sensitive data redaction (passwords, tokens, auth headers)
- Custom serializers for errors and requests
- Helper functions for child loggers and timing
- Added LOG_LEVEL environment variable to .env.example
- Configured Next.js for Turbopack with external pino packages
## Phase 2: API Request Logging
- Created API logger wrapper (lib/utils/api-logger.ts):
- withLogging() HOF for wrapping API route handlers
- Automatic request/response logging with timing
- Correlation ID generation (X-Request-ID header)
- Error catching and structured error responses
- logPerformance() helper for timing operations
- createApiLogger() for manual logging in routes
## Phase 3: Supervisor Client Logging
- Updated lib/supervisor/client.ts:
- Added logger instance to SupervisorClient class
- Comprehensive XML-RPC call logging (method, params, duration)
- Error logging with full context and stack traces
- Success logging with result size tracking
- DEBUG level logs for all XML-RPC operations
- Constructor logging for client initialization
## Configuration Changes
- Updated next.config.ts for Turbopack compatibility
- Added serverComponentsExternalPackages for pino
- Removed null-loader workaround (not needed)
## Features Implemented
✅ Request correlation IDs for tracing
✅ Performance timing for all operations
✅ Sensitive data redaction (passwords, auth)
✅ Environment-based log formatting
✅ Structured JSON logs for production
✅ Pretty colored logs for development
✅ Error serialization with stack traces
✅ Ready for log aggregation (stdout/JSON)
## Next Steps (Phases 4-7)
- Update ~30 API routes with logging
- Add React Query/hooks error logging
- Implement client-side error boundary
- Add documentation and testing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add LogViewer component with syntax highlighting and auto-scroll
- Add LogControls for play/pause, auto-scroll, refresh, download, clear
- Add LogSearch component with search highlighting
- Add Input UI component
- Fix TypeScript type issues in ProcessCard and types.ts
- Fix XML-RPC client type issues
- Add force-dynamic to layout to prevent SSR issues with client components
- Add mounted state to Navbar for theme toggle hydration
- Add custom 404 page
Components added:
- components/logs/LogViewer.tsx - Main log viewer with real-time display
- components/logs/LogControls.tsx - Control panel for log viewing
- components/logs/LogSearch.tsx - Search input for filtering logs
- components/ui/input.tsx - Reusable input component
Fixes:
- ProcessStateCode type casting in ProcessCard
- XML-RPC client options type (use any to avoid library type issues)
- canStartProcess/canStopProcess type assertions
- Dynamic rendering to prevent SSR hydration issues
🤖 Generated with Claude Code (https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Modern web interface for Supervisor process management
- Built with Next.js 16 (App Router) and Tailwind CSS 4
- Full XML-RPC client implementation for Supervisor API
- Real-time process monitoring with auto-refresh
- Process control: start, stop, restart operations
- Modern dashboard with system status and statistics
- Dark/light theme with OKLCH color system
- Docker multi-stage build with runtime env var configuration
- Gitea CI/CD workflow for automated builds
- Comprehensive documentation (README, IMPLEMENTATION, DEPLOYMENT)
Features:
- Backend proxy pattern for secure API communication
- React Query for state management and caching
- TypeScript strict mode with Zod validation
- Responsive design with mobile support
- Health check endpoint for monitoring
- Non-root user security in Docker
Environment Variables:
- SUPERVISOR_HOST, SUPERVISOR_PORT
- SUPERVISOR_USERNAME, SUPERVISOR_PASSWORD (optional)
- Configurable at build-time and runtime
🤖 Generated with Claude Code (https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>