0.7.4 access_log

Igor Sysoev is at rambler-co.ru
Mon Jun 30 19:52:57 MSD 2008


On Mon, Jun 30, 2008 at 12:49:52PM -0300, Marcos Neves wrote:

> I found that log files with variable, are created with nginx worker
> user, in my case, nobody:nogroup

Yes, they are created by worker processes only.

> Now it?s working, without need to set open_log_file_cache   max=1000;

The attached patch fixes signal 10.


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/http/ngx_http_request.c
===================================================================
--- src/http/ngx_http_request.c	(revision 1396)
+++ src/http/ngx_http_request.c	(revision 1398)
@@ -2623,6 +2623,8 @@
         r->headers_out.status = error;
     }
 
+    log->action = "logging request";
+
     cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
 
     log_handler = cmcf->phases[NGX_HTTP_LOG_PHASE].handlers.elts;
@@ -2631,6 +2633,8 @@
         log_handler[i](r);
     }
 
+    log->action = "closing request";
+
     if (r->connection->timedout) {
         clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
 
Index: src/http/modules/ngx_http_log_module.c
===================================================================
--- src/http/modules/ngx_http_log_module.c	(revision 1396)
+++ src/http/modules/ngx_http_log_module.c	(revision 1398)
@@ -422,7 +422,8 @@
     {
         ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
                       ngx_open_file_n " \"%s\" failed", log.data);
-        return -1;
+        /* simulate successfull logging */
+        return len;
     }
 
     ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
@@ -760,7 +761,8 @@
         return NGX_CONF_OK;
     }
 
-    *conf = *prev;
+    conf->logs = prev->logs;
+    conf->off = prev->off;
 
     if (conf->logs || conf->off) {
         return NGX_CONF_OK;


More information about the nginx mailing list