How do you centralize logs in a distributed system?
⚡
Quick Answer
Ship logs from every service/node with an agent (Fluentd, Fluent Bit, Filebeat) to a central store (Elasticsearch/OpenSearch or Loki) where they are indexed, searched, and dashboarded (Kibana/Grafana).
Detailed Answer
Centralization solves correlation: one query spans all services. Use structured (JSON) logs with a correlation/trace ID so you can follow a request end to end, apply retention/index lifecycle policies to control cost, and avoid logging secrets. In Kubernetes a DaemonSet agent tails container stdout on each node.
💡
Interview Tip
Mention structured logs with a correlation ID and retention policies — the details that make centralized logging actually useful.
loggingcentralizationelk