fix "access_log off"

This commit is contained in:
Igor Sysoev 2007-01-24 09:15:25 +00:00
parent 64304df431
commit 3a58cc90b5

View File

@ -155,7 +155,7 @@ ngx_module_t ngx_http_log_module = {
};
static ngx_str_t http_access_log = ngx_string(NGX_HTTP_LOG_PATH);
static ngx_str_t ngx_http_access_log = ngx_string(NGX_HTTP_LOG_PATH);
static ngx_str_t ngx_http_combined_fmt =
@ -554,19 +554,13 @@ ngx_http_log_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_http_log_fmt_t *fmt;
ngx_http_log_main_conf_t *lmcf;
if (conf->logs == NULL) {
if (conf->off) {
if (conf->logs || conf->off) {
return NGX_CONF_OK;
}
if (prev->logs) {
conf->logs = prev->logs;
*conf = *prev;
} else {
if (prev->off) {
conf->off = prev->off;
if (conf->logs || conf->off) {
return NGX_CONF_OK;
}
@ -580,7 +574,7 @@ ngx_http_log_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
return NGX_CONF_ERROR;
}
log->file = ngx_conf_open_file(cf->cycle, &http_access_log);
log->file = ngx_conf_open_file(cf->cycle, &ngx_http_access_log);
if (log->file == NULL) {
return NGX_CONF_ERROR;
}
@ -594,8 +588,6 @@ ngx_http_log_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
/* the default "combined" format */
log->ops = fmt[0].ops;
lmcf->combined_used = 1;
}
}
return NGX_CONF_OK;
}