Mercurial > hg > nginx
diff src/core/ngx_log.c @ 113:d7f606e25b99
nginx-0.0.1-2003-07-04-19:10:33 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 04 Jul 2003 15:10:33 +0000 |
parents | a9bc21d63fe4 |
children | be27f922b9a2 |
line wrap: on
line diff
--- a/src/core/ngx_log.c Fri Jul 04 06:03:52 2003 +0000 +++ b/src/core/ngx_log.c Fri Jul 04 15:10:33 2003 +0000 @@ -210,12 +210,6 @@ #endif -static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) -{ - return ngx_log_set_errlog(cf, cmd, &ngx_log); -} - - ngx_log_t *ngx_log_init_errlog() { @@ -252,11 +246,31 @@ ngx_test_null(log, ngx_pcalloc(cycle->pool, sizeof(ngx_log_t)), NULL); ngx_test_null(log->file, ngx_push_array(&cycle->open_files), NULL); + log->file->fd = NGX_INVALID_FILE; return log; } +static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) +{ + ngx_str_t *value; + + value = cf->args->elts; + + if (value[1].len == 6 && ngx_strcmp(value[1].data, "stderr") == 0) { + cf->cycle->log->file = &ngx_stderr; + + } else { + cf->cycle->log->file->name = value[1]; + } + + return NGX_CONF_OK; +} + + +#if 0 + char *ngx_log_set_errlog(ngx_conf_t *cf, ngx_command_t *cmd, ngx_log_t *log) { int len; @@ -297,3 +311,5 @@ return NGX_CONF_OK; } + +#endif