Forwarding Nginx Logs to Docker

Preface

It is fairly common practice in Docker to forward the logs from a container’s main process (as defined by or instructions) into and . The reasoning behind this decision is that the Docker daemon automatically collects any output sent to and , allowing you to tail the standard output and errors of your container using for example .

Without forwarding, say — the logs from Nginx to standard error and out, you would not know what Nginx is up to. Like what…