Comprehensive guidance for appropriate use of logging in API routes to maintain clean, useful, and performant logs.
| ERROR | Unexpected failures requiring attention | Database connection failures, unhandled exceptions, critical service errors | | WARN | Recoverable issues or concerning patterns | Rate limiting triggered, deprecated API usage, fallback behavior activated |
| INFO | Important business events (NOT routine operations) | User account created, payment processed, critical configuration changed | | DEBUG | Detailed diagnostic information | Query parameters, intermediate calculations, cache hit/miss details |
Best practices and guidelines for using logger in API routes. Defines appropriate logging levels, what to log, and when to avoid logging. Use when implementing or reviewing API route logging, debugging strategies, or optimizing log output. Source: inkeep/agents.