mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
Core: moved initialization of log level.
The cycle->new_log->log_level should only be initialized by ngx_init_cycle() if no error logs were found in the configuration. This move allows to get rid of extra initialization in ngx_error_log().
This commit is contained in:
parent
de2ec2c650
commit
aac7f7f464
@ -84,7 +84,6 @@ 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;
|
||||
@ -344,6 +343,8 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
|
||||
if (cycle->new_log.file == NULL) {
|
||||
goto failed;
|
||||
}
|
||||
|
||||
cycle->new_log.log_level = NGX_LOG_ERR;
|
||||
}
|
||||
|
||||
/* open the new files */
|
||||
|
@ -454,7 +454,5 @@ ngx_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
return NGX_CONF_OK;
|
||||
}
|
||||
|
||||
cf->cycle->new_log.log_level = 0;
|
||||
|
||||
return ngx_log_set_levels(cf, &cf->cycle->new_log);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user