Opened 6 years ago

Closed 6 years ago

#1462 closed defect (duplicate)

Logging directory is always /var/log on startup

Reported by: asymetrixs@… Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.13.x
Keywords: logging Cc:
uname -a: SunOS host 5.10 Generic_150401-50 i86pc i386 i86pc
nginx -V: nginx version: nginx/1.13.8 (i386-sun-solaris2.10)
build by gcc .3.0 (GCC)
build with OpenSSL 1.0.2k 26 Jan 2017
TLS SNI support enabled
configure arguments: --build-i386-sun-solaris2.10 --prefix=/foo/bar --sbin-path=/foo/bar/bin/nginx --conf-path=/foo/bar/etc/nginx/nginx.conf --with-cc=/foo/bar/bin/gcc --with-cpp=/foo/bar/bin/cpp --with-ld-opt='-L /foo/bar/lib' --with-cc-opt='-I /foo/bar/include' --with-threads --with-stream_ssl_module --with-stream --with-stream_ssl_prepared_module --with-http_ssl_module --with-http_v2_module --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-hhtp_degradation_module --with-http_slice_module --with-http_stub_satutus_module --with-http_perl_module --with-perl=/foo/bar/bin/perl --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --modules-path=/foo/bar/libexec/ngnx --lock-path=/var/run/nginx.lock --pid-path=/var/run/nginx.pid

Description

Configuration is:
error_log /test/dir/error.log;
access_log /test/dir/access.log;

When starting nginx, it always tries to write to /var/log/nginx/error.log first (as compiled), before using the value configured in the configuration file.

nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)

Please make it read the configuration file first and then (try to) log anything.

Change History (1)

comment:1 by Maxim Dounin, 6 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #147.

Note: See TracTickets for help on using tickets.