Opened 10 years ago

Closed 10 years ago

#593 closed defect (invalid)

Windows Access & Error Logs Not Updating File Modification Time

Reported by: Mark Johnson Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.7.x
Keywords: logging Cc:
uname -a: Windows 7 Ultimate, SP1, x64
nginx -V: nginx version: nginx/1.7.3
TLS SNI support enabled
configure arguments: --with-cc=cl --builddir=objs.msvc8 --with-debug --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --http-scgi-temp-path=temp/scgi_temp --http-uwsgi-temp-path=temp/uwsgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs.msvc8/lib/pcre-8.35 --with-zlib=objs.msvc8/lib/zlib-1.2.8 --with-select_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_stub_status_module --with-http_flv_module --with-http_mp4_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-mail --with-openssl=objs.msvc8/lib/openssl-1.0.1h --with-openssl-opt=enable-tlsext --with-http_ssl_module --with-mail_ssl_module --with-ipv6

Description

The following report is specific to Windows Nginx only.

The log files as denoted via the error_log and access_log directives do not update the file modification date/time attributes after sending data to these logs.

This is a problem because the majority of Windows programs and IDE's use the file mtime to determine if the file needs to be refreshed.

Change History (1)

comment:1 by Maxim Dounin, 10 years ago

Resolution: invalid
Status: newclosed

What nginx does is quite simple: it writes data to log files, and everything else is about OS, not about nginx.

Windows docs say though, that "When writing to a file, the last write time is not fully updated until all handles that are used for writing are closed". It's quite unlikely that this behaviour will be changed, so if you really need to monitor changes to log files being written to, you may want to use better tools than those who only check mtime.

Note: See TracTickets for help on using tickets.