Back to guides

No Logging in Production: The Problems

Production without logs is flying blind. Here's what can go wrong and how to fix it.

What this problem means

Your production app has minimal or no logging. When something breaks—a user reports an error, a request fails, or performance degrades—you have no way to trace what happened. You're debugging blind.

Why this is dangerous

- Extended outages: Without logs, diagnosing issues takes hours or days instead of minutes.

- Silent failures: Errors may go unnoticed until they compound.

- Data loss: Without audit trails, you can't trace what happened or who did what.

Real-world example

A startup had no structured logging in production. When a user reported a payment failure, they had no way to trace the request. They spent two days reproducing the issue. With request IDs and structured logs, they could have found it in minutes.

How to fix it

1. Structured logging: Use JSON logs with fields like request_id, user_id, error, and timestamp.

2. Request IDs: Generate a unique ID per request. Trace it through all services.

3. Log levels: Use ERROR, WARN, INFO. Avoid logging sensitive data (passwords, tokens).

4. Centralized: Send logs to CloudWatch, Datadog, or similar. Don't rely on local files.

5. Retention: Keep logs long enough for debugging (e.g., 30 days).

Tools and configurations

- Winston: Node.js structured logging.

- Pino: Fast JSON logger for Node.js.

- AWS CloudWatch: Centralized log storage and search.

- Datadog / New Relic: Full observability and log correlation.

Common mistakes

- Logging only in development.

- Unstructured logs (plain text, no request IDs).

- Logging sensitive data.

- No centralized log storage.

Quick checklist

- [ ] Add structured logging (JSON) with request_id

- [ ] Send logs to CloudWatch or similar

- [ ] Set retention policy (e.g., 30 days)

- [ ] Avoid logging passwords, tokens, or PII

- [ ] Document the logging strategy for your team

Need help with production readiness? Get a free 30-minute audit.

Book Free 30-Min Production Audit

View our DevSecOps services

Check if your system has this risk

Take the 60-second production readiness assessment to identify gaps in your infrastructure.

Start Assessment

Frequently asked questions

What happens if I have no logging in production?
You can't trace failures, debug issues, or audit actions. Diagnosing problems takes hours or days instead of minutes. Structured logging is essential for production.
What is structured logging?
Structured logging uses JSON with consistent fields (request_id, user_id, error, timestamp). It makes logs searchable and traceable across services.
How do I add logging to production?
Use a structured logger (Winston, Pino). Add request_id to each request. Send logs to CloudWatch or similar. Avoid logging sensitive data.