What should applications log to when containerized?
BeginnerProductionResource Limits, Health & Reliability
Answer
Stdout/stderr, as structured JSON (timestamp, level, trace ID, service), one event per line. Not files inside the container: they need rotation, vanish with the container, and cannot be read by docker logs. For legacy apps that write files, symlink them to /dev/stdout and /dev/stderr as the official nginx image does.
More on Resource Limits, Health & Reliability
How do you set memory and CPU limits, and what happens when they are exceeded?BeginnerWhat is the difference between `--cpus`, `--cpu-shares` and `--cpuset-cpus`?BeginnerWhat does `--memory-reservation` do?AdvancedHow do you diagnose an OOM-killed container?IntermediateWhy do JVM and Node services in containers need explicit memory flags?IntermediateWhat is CPU throttling, and how do you detect it?Advanced