Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 700866

Summary: www-servers/nginx: use default log names
Product: Gentoo Linux Reporter: Tomáš Mózes <hydrapolic>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: UNCONFIRMED ---    
Severity: enhancement CC: dev-zero
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Tomáš Mózes 2019-11-21 09:27:28 UTC
The default access/error logs are access.log and error.log:
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx error log file: "/usr/local/nginx/logs/error.log"

We set them to access_log and error_log:
./configure
  --http-log-path="${EPREFIX}"/var/log/${PN}/access_log
  --error-log-path="${EPREFIX}"/var/log/${PN}/error_log

Even if you set "error_log /var/log/nginx/error.log error;" in nginx.conf, you'll have an empty /var/log/nginx/error_log

I think it would be nice to use the same names as upstream does (access.log / error.log). Thanks.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2019-11-21 10:50:31 UTC
This is complicated:

Upstream is using file specified via --error-log-path configure option to log config parser issues. Upstream's idea is that you should have a chance to catch broken config especially during unattended boot. See https://trac.nginx.org/nginx/ticket/147 for more details.

I wish that upstream would provide a command-line argument to allow people to overwrite configure path at runtime because whatever name we will pick, there will be always user who want to use a different name/location.

Regarding chosen names: I can only speculate why Gentoo picked {access,error}_log instead of {access,error}.log as filename. I assume to match with Apache log names.

I am not sure if we should change this. Although I am using *.log naming schema by myself we must assume to some point that user already found out about the problem that nginx is always using file from --error-log-path option and have adopted to that file and naming. Maybe ebuild could read from NGINX_DEFAULT_ERROR_LOG environment variable for example allowing user to set a different path in configure...
Comment 2 Tomáš Mózes 2019-11-21 10:57:10 UTC
Thanks for the explanation, didn't know that.