Production applications need useful logs and monitoring. Record safe information such as request IDs, event names, response status, durations, and error categories.
Avoid logging passwords, access tokens, payment data, or other sensitive information.
Deep dive
Structured logging
Structured JSON logs are easier for log-management systems to search and aggregate. Include stable event names and identifiers instead of relying only on long free-form messages.
Monitoring metrics
Useful service metrics include request rate, error rate, latency, database latency, memory usage, and process restarts.