How do you handle logging in production?
- Use logging libraries like winston or pino for structured logs.
- Separate logs into levels (info, warn, error).
- Output logs to files or external services (Logstash, Datadog, Splunk).
- Implement log rotation to prevent disk space issues.
- Make logs easy to search and analyze.