I’ve added a robust and structured logging system to the backend using Python’s built-in logging module. Here's what’s been done:
- Centralized Logging Configuration: Set up in app.py to define format, log levels, and handlers. This ensures consistency across all modules.
- Named Loggers: Each module uses its own named logger (logger = logging.getLogger(name)) for clear traceability in logs.
- Consistent Log Format: Includes timestamp, log level, logger name, filename, line number, and the message.
- Output Destinations:
- Rotating log file: Logs are written to backend/logs/pethealth_app.log, with rotation to prevent unbounded growth.
- Console output: Via StreamHandler for real-time debugging during development. This will help with debugging, monitoring, and maintaining the system more effectively as the project scales.

Log in or sign up for Devpost to join the conversation.