comparison src/http/ngx_http_core_module.c @ 4541:2e7ac96049b8

The "error_log" directive specified in the "http", "server", and "location" sections now understands the special "stderr" parameter. It was already treated specially when specified in the main section.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 15 Mar 2012 20:04:50 +0000
parents 14411ee4d89f
children 22e613ba0925
comparison
equal deleted inserted replaced
4540:cab9aa79256c 4541:2e7ac96049b8
4645 static char * 4645 static char *
4646 ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 4646 ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
4647 { 4647 {
4648 ngx_http_core_loc_conf_t *clcf = conf; 4648 ngx_http_core_loc_conf_t *clcf = conf;
4649 4649
4650 ngx_str_t *value; 4650 ngx_str_t *value, name;
4651 4651
4652 if (clcf->error_log) { 4652 if (clcf->error_log) {
4653 return "is duplicate"; 4653 return "is duplicate";
4654 } 4654 }
4655 4655
4656 value = cf->args->elts; 4656 value = cf->args->elts;
4657 4657
4658 clcf->error_log = ngx_log_create(cf->cycle, &value[1]); 4658 if (ngx_strcmp(value[1].data, "stderr") == 0) {
4659 ngx_str_null(&name);
4660
4661 } else {
4662 name = value[1];
4663 }
4664
4665 clcf->error_log = ngx_log_create(cf->cycle, &name);
4659 if (clcf->error_log == NULL) { 4666 if (clcf->error_log == NULL) {
4660 return NGX_CONF_ERROR; 4667 return NGX_CONF_ERROR;
4661 } 4668 }
4662 4669
4663 if (cf->args->nelts == 2) { 4670 if (cf->args->nelts == 2) {