ruby on rails - how to stop dockerized nginx in foreground from flooding logs? -
i'm running nginx , unicorn in docker container managed supervisord.
so, supervisord docker command. in turn spawns nginx , unicorn. unicorn talks nginx on socket. nginx listens on port 80.
i have logspout docker container running, piping docker logs papertrail listening docker.sock.
the problem nginx spewing thousands of mundane entries logs:
172.31.45.231 - - [25/may/2016:05:53:33 +0000] "get / http/1.0" 200 12961 0.0090
i'm trying disable it.
so far i've:
set
access_logs /dev/null;
innginx.conf
, vhost files.tried tell supervisord stop logging requests
[program:nginx] command=bash -c "/usr/sbin/nginx -c /etc/nginx/nginx.conf" stdout_logfile=/dev/null stderr_logfile=/dev/null
tried tell supervisord send logs syslog not stdout:
[program:nginx] command=bash -c "/usr/sbin/nginx -c /etc/nginx/nginx.conf" stdout_logfile=syslog stderr_logfile=syslog
set log level in unicorn warn in rails code, , via env var.
full supervisord conf:
[supervisord] nodaemon=true loglevel=warn [program:unicorn] command=bundle exec unicorn -c /railsapp/config/unicorn.rb process_name=%(program_name)s_%(process_num)02d numprocs=1 stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 redirect_stderr=true [program:nginx] command=bash -c "/usr/sbin/nginx -c /etc/nginx/nginx.conf" stdout_logfile=/dev/null stderr_logfile=/dev/null
you try , change nginx log level a:
access_log off;
the goal remains modify nginx.conf
used nginx image.
Comments
Post a Comment