aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2013-06-20 20:47:39 +0400
committerVladimir Homutov <vl@nginx.com>2013-06-20 20:47:39 +0400
commit11ff177a9fe3129cd1c8b23e1850bfbc3e2c6ae1 (patch)
tree2289fc8b7b9f72564a23019ebb3438757ee74c74 /src/http/ngx_http_core_module.c
parent02cc52554f7ef326bb92df4ecced524e5d01ee19 (diff)
downloadnginx-11ff177a9fe3129cd1c8b23e1850bfbc3e2c6ae1.tar.gz
nginx-11ff177a9fe3129cd1c8b23e1850bfbc3e2c6ae1.zip
Core: support several "error_log" directives.
When several "error_log" directives are specified in the same configuration block, logs are written to all files with a matching log level. All logs are stored in the singly-linked list that is sorted by log level in the descending order. Specific debug levels (NGX_LOG_DEBUG_HTTP,EVENT, etc.) are not supported if several "error_log" directives are specified. In this case all logs will use debug level that has largest absolute value.
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 4403fa308..b32a8842c 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -4888,33 +4888,7 @@ ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_http_core_loc_conf_t *clcf = conf;
- ngx_str_t *value, name;
-
- if (clcf->error_log) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[1].data, "stderr") == 0) {
- ngx_str_null(&name);
- cf->cycle->log_use_stderr = 1;
-
- } else {
- name = value[1];
- }
-
- clcf->error_log = ngx_log_create(cf->cycle, &name);
- if (clcf->error_log == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (cf->args->nelts == 2) {
- clcf->error_log->log_level = NGX_LOG_ERR;
- return NGX_CONF_OK;
- }
-
- return ngx_log_set_levels(cf, clcf->error_log);
+ return ngx_log_set_log(cf, &clcf->error_log);
}