แอปพลิเคชันแบบ container ต้องการ logging แบบรวมศูนย์ และ monitoring เพราะ container ไม่ถาวรและมีจำนวนมาก — logs และ metrics ต้องถูกเก็บรวบรวมไว้ภายนอกเพื่อให้คงอยู่หลังจากที่ container ถูกลบและให้มองเห็นภาพรวมทั้งระบบ นี่เป็น observability ที่จำเป็นสำหรับ container ใน production
Logging: log ไปยัง stdout/stderr แล้วรวบรวมแบบรวมศูนย์
BEST PRACTICE: containers should log to STDOUT/STDERR (not to files inside the container):
→ Docker captures these (`docker logs`); a logging DRIVER forwards them elsewhere
→ WHY: containers are EPHEMERAL — logs in a removed container are LOST. Centralize them.
Logging drivers / pipelines forward logs to a central system:
→ json-file (default), syslog, fluentd, awslogs, gelf, etc. (--log-driver)
→ Aggregation stacks: ELK/Elastic (Elasticsearch+Logstash+Kibana), Loki+Grafana,
cloud logging (CloudWatch, Stackdriver), Datadog, etc.
→ Centralized logs: searchable, persistent, span ALL containers/hosts → real visibility
