કન્ટેનરાઇઝ્ડ એપ્લીકેશનને કેન્દ્રીયકૃત લોગિંગ અને મોનિટરિંગ જરૂરી છે કારણ કે કન્ટેનરો અસ્થાયી અને અસંખ્ય છે — લોગ્સ અને મેટ્રિક્સ બાહ્ય રીતે સંગ્રહ કરવા જોઈએ જેથી તે કન્ટેનર નિકાલ કર્યા પછી પણ સ્થાયી રહે અને સમગ્ર સિસ્ટમ જુઓ. આ ઉત્પાદન કન્ટેનરો માટે આવશ્યક નિરીક્ષણ છે.
લોગિંગ: 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
