Feature Request for access_log stdout;

Aleksandar Lazic al-nginx at none.at
Thu Feb 18 23:56:21 UTC 2016


Hi.

Am 18-02-2016 15:02, schrieb Aleksandar Lazic:
> Hi Andrew.
> 
> Am 18-02-2016 10:16, schrieb Andrew Hutchings:

[snipp]

>>> What version of Docker are you running? If it is prior to 1.9 you are
>>> likely to hit his bug: https://github.com/docker/docker/issues/6880
> 
> ####
> docker version
> Client:
>  Version:      1.8.2-el7
>  API version:  1.20
>  Package Version: docker-1.8.2-10.el7.x86_64
>  Go version:   go1.4.2
>  Git commit:   a01dc02/1.8.2
>  Built:
>  OS/Arch:      linux/amd64
> 
> Server:
>  Version:      1.8.2-el7
>  API version:  1.20
>  Package Version:
>  Go version:   go1.4.2
>  Git commit:   a01dc02/1.8.2
>  Built:
>  OS/Arch:      linux/amd64
> ####
> 
>> Also, as Valentin mentioned. Performance of any application, not just
>> NGINX, that logs a lot of data is going to be terrible when you
>> actually manage to do this.
> 
> I have received some suggestions on haproxy list, which I will try.

I have try to setup the syslog entry with variables, but it looks to me 
that this not implemented.

sed -e's/access_log.*/access_log 
syslog:server=\$\{NGINX_TEST_PORT_8514_UDP_ADDR\}:\$\{NGINX_TEST_PORT_8514_UDP_PORT\};/' 
/etc/nginx/nginx.conf > /tmp/nginx.conf

cat /tmp/nginx.conf

#####
user  nginx;
worker_processes  1;

error_log stderr warn;
pid /tmp/nginx.pid;


events {
     worker_connections  1024;
}


http {
     include       /etc/nginx/mime.types;
     default_type  application/octet-stream;

     log_format  main  '$remote_addr - $remote_user [$time_local] 
"$request" '
                       '$status $body_bytes_sent "$http_referer" '
                       '"$http_user_agent" "$http_x_forwarded_for"';

     access_log 
syslog:server=${NGINX_TEST_PORT_8514_UDP_ADDR}:${NGINX_TEST_PORT_8514_UDP_PORT};

     sendfile        on;
     #tcp_nopush     on;

     keepalive_timeout  65;

     #gzip  on;

     include /etc/nginx/conf.d/*.conf;
}
####

nginx -T -c /tmp/nginx.conf

nginx: [alert] could not open error log file: open() 
"/var/log/nginx/error.log" failed (13: Permission denied)
2016/02/18 23:54:51 [warn] 12#12: the "user" directive makes sense only 
if the master process runs with super-user privileges, ignored in 
/tmp/nginx.conf:2
2016/02/18 23:54:51 [emerg] 12#12: invalid port in syslog server 
"${NGINX_TEST_PORT_8514_UDP_ADDR}:${NGINX_TEST_PORT_8514_UDP_PORT}" in 
/tmp/nginx.conf:22
nginx: configuration file /tmp/nginx.conf test failed

Any plans to add this possibility or have I missed something?

BR
Aleks



More information about the nginx mailing list