Interview Prep/Docker/Volumes, storage and data

Should log files go to a volume?

BeginnerScenarioVolumes, storage and data
Answer

Situation read → Apps writing to /var/log/app.log inside the container.

What I'd do → Log to stdout/stderr so Docker's logging driver collects them. For legacy apps symlink /var/log/app.log to /dev/stdout as the nginx image does.

Why → Works with docker logs, centralized shippers and rotation, with no volume to clean.

Interview tip → Twelve-factor: treat logs as event streams.

All Docker questions Roadmap: Docker & containers

More on Volumes, storage and data