Repaso
EspaƱol
Cloud & DevOpsCoreOPS-38

In a containerized app, where should application logs go?

Options

  1. To a file inside the container, and nowhere else at all
  2. To stdout or stderr, where the platform collects them (Correct option)
  3. Nowhere, since logs are not needed for apps in production
  4. By email to the team each time that an event happens

Answer

To standard output (stdout/stderr), where the platform collects and ships them to a logging system

Why

Files inside a container disappear when it is replaced, and with many containers you could never find them.

Write logs to stdout/stderr; Docker and Kubernetes capture them, and a logging stack (CloudWatch, ELK, Loki, Datadog) collects them centrally so you can search across all instances.

Structured logs (JSON with fields like request_id) are easier to search.

Remember

Containers: log to stdout, collect centrally.

Key terms

Practice this question in Repaso