diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2003-07-04 15:10:33 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2003-07-04 15:10:33 +0000 |
| commit | 340b03b201c77f394cc70fda4d960ad6c3b68905 (patch) | |
| tree | c4a4fd6a958f2ae6c5ebed768e2c461197219df2 /src/core/ngx_log.c | |
| parent | be3c2b69a4c18e3810b1ed1ba407f0be37230c27 (diff) | |
| download | nginx-340b03b201c77f394cc70fda4d960ad6c3b68905.tar.gz nginx-340b03b201c77f394cc70fda4d960ad6c3b68905.tar.bz2 | |
nginx-0.0.1-2003-07-04-19:10:33 import
Diffstat (limited to 'src/core/ngx_log.c')
| -rw-r--r-- | src/core/ngx_log.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c index 51bae3d1a..2f8276bb6 100644 --- a/src/core/ngx_log.c +++ b/src/core/ngx_log.c @@ -210,12 +210,6 @@ void ngx_log_stderr(ngx_event_t *ev) #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_log_t *ngx_log_create_errlog(ngx_cycle_t *cycle) 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 @@ char *ngx_log_set_errlog(ngx_conf_t *cf, ngx_command_t *cmd, ngx_log_t *log) return NGX_CONF_OK; } + +#endif |
