aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.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/http/ngx_http_core_module.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/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 825c8395c..4b300dfd5 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1292,10 +1292,10 @@ ngx_http_update_location_config(ngx_http_request_t *r)
}
if (r == r->main) {
- r->connection->log->file = clcf->err_log->file;
+ r->connection->log->file = clcf->error_log->file;
if (!(r->connection->log->log_level & NGX_LOG_DEBUG_CONNECTION)) {
- r->connection->log->log_level = clcf->err_log->log_level;
+ r->connection->log->log_level = clcf->error_log->log_level;
}
}
@@ -2929,7 +2929,7 @@ ngx_http_core_create_loc_conf(ngx_conf_t *cf)
* lcf->post_action = { 0, NULL };
* lcf->types = NULL;
* lcf->default_type = { 0, NULL };
- * lcf->err_log = NULL;
+ * lcf->error_log = NULL;
* lcf->error_pages = NULL;
* lcf->try_files = NULL;
* lcf->client_body_path = NULL;
@@ -3109,11 +3109,11 @@ ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
}
}
- if (conf->err_log == NULL) {
- if (prev->err_log) {
- conf->err_log = prev->err_log;
+ if (conf->error_log == NULL) {
+ if (prev->error_log) {
+ conf->error_log = prev->error_log;
} else {
- conf->err_log = cf->cycle->new_log;
+ conf->error_log = &cf->cycle->new_log;
}
}
@@ -4104,14 +4104,23 @@ ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_str_t *value;
+ if (lcf->error_log) {
+ return "is duplicate";
+ }
+
value = cf->args->elts;
- lcf->err_log = ngx_log_create_errlog(cf->cycle, &value[1]);
- if (lcf->err_log == NULL) {
+ lcf->error_log = ngx_log_create(cf->cycle, &value[1]);
+ if (lcf->error_log == NULL) {
return NGX_CONF_ERROR;
}
- return ngx_set_error_log_levels(cf, lcf->err_log);
+ if (cf->args->nelts == 2) {
+ lcf->error_log->log_level = NGX_LOG_ERR;
+ return NGX_CONF_OK;
+ }
+
+ return ngx_log_set_levels(cf, lcf->error_log);
}