bigchaindb/nginx_3scale

Redirect all nginx logs to stdout

krish7919 opened this issue · 1 comments

This will allow log analysis and alerting modules to pick them up.
Better yet: Pipe them both to stdout and a file.

I currently see this in the NGINX container:

ls -l
total 10848
lrwxrwxrwx 1 root root      11 Apr 23 00:06 access.log -> /dev/stdout
lrwxrwxrwx 1 root root      11 Apr 23 00:06 error.log -> /dev/stderr
-rw-r--r-- 1 root root 9786488 May 19 09:29 nginx.access.log
-rw-r--r-- 1 root root 1308717 May 19 09:27 nginx.error.log

So, access.log and error.log is already mapped to the stdout and stderr respectively.
In theory, a simple update in the NGINX conf file to:

  1. error_log /usr/local/openresty/nginx/logs/error.log;
  2. access_log /usr/local/openresty/nginx/logs/access.log combined buffer=16k flush=5s;
  3. # access_log /usr/local/openresty/nginx/logs/access.log mdb_log buffer=16k flush=5s;
    should do the trick.