From b43f9d088bc3476a0377b7d216e1c7bc055857f0 Mon Sep 17 00:00:00 2001 From: chafikhnini Date: Tue, 11 Aug 2015 16:32:18 +0200 Subject: [PATCH] Add documentation on logging I spent a long time trying to figure out why my `/var/log/nginx/error.log` and `/var/log/nginx/access.log` were always empty before finding this great blog article : https://blog.docker.com/2015/04/tips-for-deploying-nginx-official-image-with-docker/. Putting this directly in the docs should save time to a lot of users working with this image. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 0145511..49953bf 100644 --- a/README.md +++ b/README.md @@ -27,3 +27,9 @@ This repository contains **Dockerfile** of [Nginx](http://nginx.org/) for [Docke docker run -d -p 80:80 -v :/etc/nginx/conf.d -v :/etc/nginx/certs -v :/var/log/nginx -v :/var/www/html dockerfile/nginx After few seconds, open `http://` to see the welcome page. + +#### Logging + +Access and error logs are sent to the Docker log collector by default by linking them to stdout and stderr, which causes all messages from both logs to be stored in the file/var/lib/docker/containers/\/\-json.log on the Docker Host. To access the logs from the command line : + + docker logs