Skip to content

Commit

Permalink
Merge pull request #24 from nginxinc/nginx-logs-to-docker-logs
Browse files Browse the repository at this point in the history
Added forwarding NGINX access and error logs to docker log collector
  • Loading branch information
pleshakov committed May 5, 2016
2 parents 3138c71 + d5c374b commit 7211908
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nginx-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC64107

EXPOSE 80 443

# forward nginx access and error logs to stdout and stderr of the ingress
# controller process
RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \
&& ln -sf /proc/1/fd/2 /var/log/nginx/error.log

COPY nginx-ingress /
COPY nginx/ingress.tmpl /

Expand Down
5 changes: 5 additions & 0 deletions nginx-plus-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ RUN apt-get update && apt-get install -y nginx-plus

EXPOSE 80 443 8080

# forward nginx access and error logs to stdout and stderr of the ingress
# controller process
RUN ln -sf /proc/1/fd/1 /var/log/nginx/access.log \
&& ln -sf /proc/1/fd/2 /var/log/nginx/error.log

COPY nginx-plus-ingress /
COPY nginx/ingress.tmpl /

Expand Down
1 change: 1 addition & 0 deletions nginx-plus-controller/nginx/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const statusAPIConf = `server {
}
location /status {
access_log off;
status;
}
}`
Expand Down

0 comments on commit 7211908

Please sign in to comment.