如何停止在前台dockerized nginx淹没日志?
我在一个由supervisordpipe理的docker容器中运行nginx和独angular兽。
所以,supervisord是docker的命令。 它反过来产生nginx和独angular兽。 独angular兽通过套接字与nginx交谈。 nginx监听端口80。
我也有一个logspout泊坞窗容器运行,基本上通过监听docker.sock将所有的docker日志传送到papertrail。
问题是nginx正在不断向成千上万的日志input日志:
172.31.45.231 - - [25/May/2016:05:53:33 +0000] "GET / HTTP/1.0" 200 12961 0.0090
我试图禁用它。
到目前为止我已经:
-
设置
access_logs /dev/null;
在nginx.conf
和vhost文件中。 -
试图告诉supervisord停止logging请求
[program:nginx] command = bash -c“/ usr / sbin / nginx -c /etc/nginx/nginx.conf”stdout_logfile = / dev / null stderr_logfile = / dev / null
-
试图告诉supervisord发送日志到syslog不是标准输出:
[program:nginx] command = bash -c“/ usr / sbin / nginx -c /etc/nginx/nginx.conf”stdout_logfile = syslog stderr_logfile = syslog
-
将Unicorn中的日志级别设置为Rails代码中的Warn,并通过env var。
全面监督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
你可以尝试改变nginx日志级别 :
access_log off;
目标仍然是修改nginx镜像使用的nginx.conf
。