diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2005-11-15 13:30:52 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2005-11-15 13:30:52 +0000 |
| commit | 0e5dc5cff692f532f0ccb2655ab196995f4233e0 (patch) | |
| tree | f56f40e788077b9820ebb45f3e0739fabb7be421 /src/http/modules/ngx_http_log_module.c | |
| parent | 2a7f83eceda87e520f36bbfb16b82b8c2d6606d7 (diff) | |
| download | nginx-0e5dc5cff692f532f0ccb2655ab196995f4233e0.tar.gz nginx-0e5dc5cff692f532f0ccb2655ab196995f4233e0.tar.bz2 | |
nginx-0.3.10-RELEASE importrelease-0.3.10
*) Change: the "valid_referers" directive and the "$invalid_referer"
variable were moved to the new ngx_http_referer_module from the
ngx_http_rewrite_module.
*) Change: the "$apache_bytes_sent" variable name was changed to
"$body_bytes_sent".
*) Feature: the "$sent_http_..." variables.
*) Feature: the "if" directive supports the "=" and "!=" operations.
*) Feature: the "proxy_pass" directive supports the HTTPS protocol.
*) Feature: the "proxy_set_body" directive.
*) Feature: the "post_action" directive.
*) Feature: the ngx_http_empty_gif_module.
*) Feature: the "worker_cpu_affinity" directive for Linux.
*) Bugfix: the "rewrite" directive did not unescape URI part in
redirect, now it is unescaped except the %00-%25 and %7F-%FF
characters.
*) Bugfix: nginx could not be built by the icc 9.0 compiler.
*) Bugfix: if the SSI was enabled for zero size static file, then the
chunked response was encoded incorrectly.
Diffstat (limited to 'src/http/modules/ngx_http_log_module.c')
| -rw-r--r-- | src/http/modules/ngx_http_log_module.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c index e83207042..3bcf73ac9 100644 --- a/src/http/modules/ngx_http_log_module.c +++ b/src/http/modules/ngx_http_log_module.c @@ -55,7 +55,7 @@ static u_char *ngx_http_log_status(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op); static u_char *ngx_http_log_bytes_sent(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op); -static u_char *ngx_http_log_apache_bytes_sent(ngx_http_request_t *r, +static u_char *ngx_http_log_body_bytes_sent(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op); static u_char *ngx_http_log_request_length(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op); @@ -173,7 +173,7 @@ static ngx_str_t http_access_log = ngx_string(NGX_HTTP_LOG_PATH); static ngx_str_t ngx_http_combined_fmt = ngx_string("$remote_addr - $remote_user [$time_gmt] " - "\"$request\" $status $apache_bytes_sent " + "\"$request\" $status $body_bytes_sent " "\"$http_referer\" \"$http_user_agent\""); @@ -186,8 +186,10 @@ static ngx_http_log_var_t ngx_http_log_vars[] = { { ngx_string("request_time"), NGX_TIME_T_LEN, ngx_http_log_request_time }, { ngx_string("status"), 3, ngx_http_log_status }, { ngx_string("bytes_sent"), NGX_OFF_T_LEN, ngx_http_log_bytes_sent }, + { ngx_string("body_bytes_sent"), NGX_OFF_T_LEN, + ngx_http_log_body_bytes_sent }, { ngx_string("apache_bytes_sent"), NGX_OFF_T_LEN, - ngx_http_log_apache_bytes_sent }, + ngx_http_log_body_bytes_sent }, { ngx_string("request_length"), NGX_SIZE_T_LEN, ngx_http_log_request_length }, @@ -209,7 +211,7 @@ ngx_http_log_op_name_t ngx_http_log_fmt_ops[] = { { ngx_string("length"), NGX_OFF_T_LEN, NULL, NULL, ngx_http_log_bytes_sent }, { ngx_string("apache_length"), NGX_OFF_T_LEN, - NULL, NULL, ngx_http_log_apache_bytes_sent }, + NULL, NULL, ngx_http_log_body_bytes_sent }, { ngx_string("request_length"), NGX_SIZE_T_LEN, NULL, NULL, ngx_http_log_request_length }, @@ -429,7 +431,7 @@ ngx_http_log_bytes_sent(ngx_http_request_t *r, u_char *buf, static u_char * -ngx_http_log_apache_bytes_sent(ngx_http_request_t *r, u_char *buf, +ngx_http_log_body_bytes_sent(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op) { off_t length; @@ -811,7 +813,7 @@ ngx_http_log_transfer_encoding_header_out(ngx_http_request_t *r, u_char *buf, } -static ngx_int_t +static ngx_int_t ngx_http_log_variable_compile(ngx_conf_t *cf, ngx_http_log_op_t *op, ngx_str_t *value) { @@ -1220,7 +1222,7 @@ ngx_http_log_compile_format(ngx_conf_t *cf, ngx_array_t *ops, if (arg_len == 0) { fname[fname_len] = '\0'; ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, - "\"%s\" requires argument", + "\"%s\" requires argument", data); return NGX_CONF_ERROR; } @@ -1298,6 +1300,12 @@ ngx_http_log_compile_format(ngx_conf_t *cf, ngx_array_t *ops, goto invalid; } + if (ngx_strncmp(var.data, "apache_bytes_sent", 17) == 0) { + ngx_conf_log_error(NGX_LOG_WARN, cf, 0, + "use \"$body_bytes_sent\" instead of " + "\"$apache_bytes_sent\""); + } + for (v = ngx_http_log_vars; v->name.len; v++) { if (v->name.len == var.len |
