diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-09-30 10:38:49 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-09-30 10:38:49 +0400 |
commit | 6d2eb207117886001038fd77978f2ad65f805512 (patch) | |
tree | 0f5b76bb639f3d8f916cd5cc3f7f3ba6629b2b75 /src/core | |
parent | ff8da91784ae67ef3b5daa6ebbbbef2ec728729f (diff) |
nginx-0.1.0-2004-09-30-10:38:49 import
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ngx_core.h | 1 | ||||
-rw-r--r-- | src/core/ngx_log.c | 22 |
2 files changed, 17 insertions, 6 deletions
diff --git a/src/core/ngx_core.h b/src/core/ngx_core.h index 909ab8edf..02a4a17b9 100644 --- a/src/core/ngx_core.h +++ b/src/core/ngx_core.h @@ -58,7 +58,6 @@ typedef void (*ngx_event_handler_pt)(ngx_event_t *ev); #include <ngx_regex.h> #endif #include <ngx_rbtree.h> -#include <ngx_radix_tree.h> #include <ngx_times.h> #include <ngx_inet.h> #include <ngx_cycle.h> diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c index 07df34474..fd8f9d940 100644 --- a/src/core/ngx_log.c +++ b/src/core/ngx_log.c @@ -253,10 +253,11 @@ ngx_log_t *ngx_log_init_errlog() #endif ngx_log.file = &ngx_stderr; - ngx_log.log_level = NGX_LOG_ERR; #ifdef NGX_ERROR_LOG_PATH + ngx_log.log_level = NGX_LOG_ERR; + fd = ngx_open_file(NGX_ERROR_LOG_PATH, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND); @@ -285,6 +286,10 @@ ngx_log_t *ngx_log_init_errlog() #endif +#else + + ngx_log.log_level = NGX_LOG_INFO; + #endif return &ngx_log; @@ -375,12 +380,19 @@ static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) value = cf->args->elts; - cf->cycle->new_log->file->name = value[1]; + if (value[1].len == 6 && ngx_strcmp(value[1].data, "stderr") == 0) { + cf->cycle->new_log->file->fd = ngx_stderr.fd; + cf->cycle->new_log->file->name.len = 0; + cf->cycle->new_log->file->name.data = NULL; + + } else { + cf->cycle->new_log->file->name = value[1]; - if (ngx_conf_full_name(cf->cycle, &cf->cycle->new_log->file->name) + if (ngx_conf_full_name(cf->cycle, &cf->cycle->new_log->file->name) == NGX_ERROR) - { - return NGX_CONF_ERROR; + { + return NGX_CONF_ERROR; + } } return ngx_set_error_log_levels(cf, cf->cycle->new_log); |