diff -up nginx-1.16.1/src/core/ngx_open_file_cache.c.orig nginx-1.16.1/src/core/ngx_open_file_cache.c
--- nginx-1.16.1/src/core/ngx_open_file_cache.c.orig	2019-08-13 14:51:43.000000000 +0200
+++ nginx-1.16.1/src/core/ngx_open_file_cache.c	2019-08-27 22:26:15.942692036 +0200
@@ -496,6 +496,10 @@ ngx_openat_file_owner(ngx_fd_t at_fd, co
     ngx_err_t        err;
     ngx_file_info_t  fi, atfi;
 
+    ngx_log_debug0(NGX_LOG_DEBUG_CORE, log, 0,
+                   "ngx_openat_file_owner(): enter");
+
+
     /*
      * To allow symlinks with the same owner, use openat() (followed
      * by fstat()) and fstatat(AT_SYMLINK_NOFOLLOW), and then compare
@@ -508,9 +512,16 @@ ngx_openat_file_owner(ngx_fd_t at_fd, co
      * symlink during openat() or not).
      */
 
+    ngx_log_debug5(NGX_LOG_DEBUG_CORE, log, 0,
+                   "ngx_openat_file_owner(): ngx_openat_file(name=\"%s\", fd=#%d, mode=%d, create=%d, access=%d)",
+                    name, at_fd, mode, create, access);
+
     fd = ngx_openat_file(at_fd, name, mode, create, access);
 
     if (fd == NGX_INVALID_FILE) {
+        ngx_log_debug0(NGX_LOG_DEBUG_CORE, log, 0,
+                       "ngx_openat_file_owner(): ngx_openat_file(): failed (invalid file)");
+
         return NGX_INVALID_FILE;
     }
 
@@ -616,6 +627,9 @@ ngx_open_file_wrapper(ngx_str_t *name, n
 {
     ngx_fd_t  fd;
 
+    ngx_log_debug0(NGX_LOG_DEBUG_CORE, log, 0,
+                   "ngx_open_file_wrapper(): enter");
+
 #if !(NGX_HAVE_OPENAT)
 
     fd = ngx_open_file(name->data, mode, create, access);
@@ -730,6 +744,10 @@ ngx_open_file_wrapper(ngx_str_t *name, n
         p = cp + 1;
         at_fd = fd;
         at_name.len = cp - at_name.data;
+
+        ngx_log_debug6(NGX_LOG_DEBUG_CORE, log, 0,
+                       "ngx_open_file_wrapper(): for_loop_end: p=\"%s\"(addr:%p), cp=\"%s\"(addr:%p), end=\"%s\"(addr:%p)",
+                       p, (void *) p, cp, (void *) cp, end, (void *) end);
     }
 
     if (p == end) {
diff -up nginx-1.16.1/src/http/modules/ngx_http_log_module.c.orig nginx-1.16.1/src/http/modules/ngx_http_log_module.c
--- nginx-1.16.1/src/http/modules/ngx_http_log_module.c.orig	2019-08-26 09:52:19.418500356 +0200
+++ nginx-1.16.1/src/http/modules/ngx_http_log_module.c	2019-08-27 22:30:40.716325347 +0200
@@ -481,6 +481,9 @@ ngx_http_log_script_write(ngx_http_reque
 
     clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
 
+    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                   "ngx_http_log_script_write(): enter");
+
     if (!r->root_tested) {
 
         /* test root directory existence */
@@ -490,8 +493,14 @@ ngx_http_log_script_write(ngx_http_reque
             return len;
         }
 
+        ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                       "ngx_http_log_script_write(): ngx_http_map_uri_to_path(): path=\"%s\"(len:%d), root=len:%d", path.data, path.len, root);
+
         path.data[root] = '\0';
 
+        ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                       "ngx_http_log_script_write(): after_truncate_root: path=\"%s\"(len:%d)", path.data, path.len);
+
         ngx_memzero(&of, sizeof(ngx_open_file_info_t));
 
         of.valid = clcf->open_file_cache_valid;
@@ -515,7 +524,7 @@ ngx_http_log_script_write(ngx_http_reque
             }
 
             ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err,
-                          "testing \"%s\" existence failed", path.data);
+                          "testing file \"%s\" existence failed", path.data);
 
             /* simulate successful logging */
             return len;
@@ -523,7 +532,7 @@ ngx_http_log_script_write(ngx_http_reque
 
         if (!of.is_dir) {
             ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR,
-                          "testing \"%s\" existence failed", path.data);
+                          "testing directory \"%s\" existence failed", path.data);
 
             /* simulate successful logging */
             return len;
