Different log formats from many containers are hard to query.
BeginnerScenarioLimits, logging, health checks and restarts
Answer
Situation read → Unstructured text.
What I'd do → Standardize on JSON logs (timestamp, level, service, trace_id) from the app and let the collector add container labels. Use Docker labels/tag log option to add metadata: --log-opt tag="{{.Name}}".
Why → Consistent fields enable dashboards and alerts.
Interview tip → Correlation IDs across services are the payoff.
More on Limits, logging, health checks and restarts
A Java container is OOM-killed at 512 MB. Why isn't the heap the whole story?IntermediateHow do you cap CPU and memory for a container and what happens on exceed?BeginnerLatency spikes though CPU usage looks low (50%).Advanced`docker logs` is empty but the app is running.BeginnerConfigure log rotation globally.BeginnerShip container logs to a central system.Intermediate