aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_cycle.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-04-30 13:53:42 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-04-30 13:53:42 +0000
commit0cd76ea2902588a7f3baea47407c48956aaa19e6 (patch)
tree34e7bfe5726c80f084bd6a7f04a3d40b3e0cb877 /src/core/ngx_cycle.c
parent06d4aa1883034b6117a29887bc90a74ae433f3fd (diff)
downloadnginx-0cd76ea2902588a7f3baea47407c48956aaa19e6.tar.gz
nginx-0cd76ea2902588a7f3baea47407c48956aaa19e6.zip
*) refactor error_log processing: listen socket log might inherit built-in
error_log with zero level, and r2447, r2466, r2467 were not enough *) remove bogus "stderr" level *) some functions and fields renames
Diffstat (limited to 'src/core/ngx_cycle.c')
-rw-r--r--src/core/ngx_cycle.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index 15f8e8d24..251892b74 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -82,6 +82,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
cycle->pool = pool;
cycle->log = log;
+ cycle->new_log.log_level = NGX_LOG_ERR;
cycle->old_cycle = old_cycle;
cycle->conf_prefix.len = old_cycle->conf_prefix.len;
@@ -165,14 +166,6 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
return NULL;
}
-
- cycle->new_log = ngx_log_create_errlog(cycle, &error_log);
- if (cycle->new_log == NULL) {
- ngx_destroy_pool(pool);
- return NULL;
- }
-
-
n = old_cycle->listening.nelts ? old_cycle->listening.nelts : 10;
cycle->listening.elts = ngx_pcalloc(pool, n * sizeof(ngx_listening_t));
@@ -336,6 +329,13 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
}
+ if (cycle->new_log.file == NULL) {
+ cycle->new_log.file = ngx_conf_open_file(cycle, &error_log);
+ if (cycle->new_log.file == NULL) {
+ goto failed;
+ }
+ }
+
/* open the new files */
part = &cycle->open_files.part;
@@ -382,12 +382,8 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
#endif
}
- cycle->log = cycle->new_log;
- pool->log = cycle->new_log;
-
- if (cycle->log->log_level == 0) {
- cycle->log->log_level = NGX_LOG_ERR;
- }
+ cycle->log = &cycle->new_log;
+ pool->log = &cycle->new_log;
/* create shared memory */