Skip to content

Instantly share code, notes, and snippets.

@zeddee
Created January 1, 2018 00:19
Show Gist options
  • Save zeddee/baa5d8257beeb2a4bc24e005ddd62d54 to your computer and use it in GitHub Desktop.
Save zeddee/baa5d8257beeb2a4bc24e005ddd62d54 to your computer and use it in GitHub Desktop.

Quick notes on Docker Logging

Can make use of docker logging features by symlinking log files to /dev/stdout and /dev/stderr. E.g.:

RUN ln -sf /dev/stdout /var/log/nginx/access.log &&\
    && ln -sf /dev/stderr /var/log/nginx/error.log

This is also another metric for whether your containers are too complex -- symlinking one file to stdout and the error log to stderr should be enough to keep track of how your container is doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment