mirror of
https://github.com/nginx/nginx.git
synced 2025-08-06 14:56:15 +08:00
change ngx_log_create_errlog() interface
This commit is contained in:
parent
7b9feda70b
commit
c134eb058d
@ -303,18 +303,9 @@ ngx_log_init(void)
|
|||||||
|
|
||||||
|
|
||||||
ngx_log_t *
|
ngx_log_t *
|
||||||
ngx_log_create_errlog(ngx_cycle_t *cycle, ngx_array_t *args)
|
ngx_log_create_errlog(ngx_cycle_t *cycle, ngx_str_t *name)
|
||||||
{
|
{
|
||||||
ngx_log_t *log;
|
ngx_log_t *log;
|
||||||
ngx_str_t *value, *name;
|
|
||||||
|
|
||||||
if (args) {
|
|
||||||
value = args->elts;
|
|
||||||
name = &value[1];
|
|
||||||
|
|
||||||
} else {
|
|
||||||
name = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
log = ngx_pcalloc(cycle->pool, sizeof(ngx_log_t));
|
log = ngx_pcalloc(cycle->pool, sizeof(ngx_log_t));
|
||||||
if (log == NULL) {
|
if (log == NULL) {
|
||||||
|
@ -196,7 +196,7 @@ void ngx_cdecl ngx_log_debug_core(ngx_log_t *log, ngx_err_t err,
|
|||||||
/*********************************/
|
/*********************************/
|
||||||
|
|
||||||
ngx_log_t *ngx_log_init(void);
|
ngx_log_t *ngx_log_init(void);
|
||||||
ngx_log_t *ngx_log_create_errlog(ngx_cycle_t *cycle, ngx_array_t *args);
|
ngx_log_t *ngx_log_create_errlog(ngx_cycle_t *cycle, ngx_str_t *name);
|
||||||
char *ngx_set_error_log_levels(ngx_conf_t *cf, ngx_log_t *log);
|
char *ngx_set_error_log_levels(ngx_conf_t *cf, ngx_log_t *log);
|
||||||
void ngx_log_abort(ngx_err_t err, const char *text, void *param);
|
void ngx_log_abort(ngx_err_t err, const char *text, void *param);
|
||||||
void ngx_cdecl ngx_log_stderr(ngx_err_t err, const char *fmt, ...);
|
void ngx_cdecl ngx_log_stderr(ngx_err_t err, const char *fmt, ...);
|
||||||
|
@ -4101,7 +4101,11 @@ ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
{
|
{
|
||||||
ngx_http_core_loc_conf_t *lcf = conf;
|
ngx_http_core_loc_conf_t *lcf = conf;
|
||||||
|
|
||||||
lcf->err_log = ngx_log_create_errlog(cf->cycle, cf->args);
|
ngx_str_t *value;
|
||||||
|
|
||||||
|
value = cf->args->elts;
|
||||||
|
|
||||||
|
lcf->err_log = ngx_log_create_errlog(cf->cycle, &value[1]);
|
||||||
if (lcf->err_log == NULL) {
|
if (lcf->err_log == NULL) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user