Mercurial > hg > nginx
comparison src/http/modules/ngx_http_log_module.c @ 581:326634fb9d47 release-0.3.12
nginx-0.3.12-RELEASE import
*) Security: if nginx was built with the ngx_http_realip_module and the
"satisfy_any on" directive was used, then access and authorization
directives did not work. The ngx_http_realip_module was not built
and is not built by default.
*) Change: the "$time_gmt" variable name was changed to "$time_local".
*) Change: the "proxy_header_buffer_size" and
"fastcgi_header_buffer_size" directives was renamed to the
"proxy_buffer_size" and "fastcgi_buffer_size" directives.
*) Feature: the ngx_http_memcached_module.
*) Feature: the "proxy_buffering" directive.
*) Bugfix: the changes in accept mutex handling when the "rtsig" method
was used; the bug had appeared in 0.3.0.
*) Bugfix: if the client sent the "Transfer-Encoding: chunked" header
line, then nginx returns the 411 error.
*) Bugfix: if the "auth_basic" directive was inherited from the http
level, then the realm in the "WWW-Authenticate" header line was
without the "Basic realm" text.
*) Bugfix: if the "combined" format was explicitly specified in the
"access_log" directive, then the empty lines was written to the log;
the bug had appeared in 0.3.8.
*) Bugfix: nginx did not run on the sparc platform under any OS except
Solaris.
*) Bugfix: now it is not necessary to place space between the quoted
string and closing bracket in the "if" directive.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sat, 26 Nov 2005 10:11:11 +0000 |
parents | 4d9ea73a627a |
children | f971949ffb58 |
comparison
equal
deleted
inserted
replaced
580:8393757dc220 | 581:326634fb9d47 |
---|---|
170 | 170 |
171 static ngx_str_t http_access_log = ngx_string(NGX_HTTP_LOG_PATH); | 171 static ngx_str_t http_access_log = ngx_string(NGX_HTTP_LOG_PATH); |
172 | 172 |
173 | 173 |
174 static ngx_str_t ngx_http_combined_fmt = | 174 static ngx_str_t ngx_http_combined_fmt = |
175 ngx_string("$remote_addr - $remote_user [$time_gmt] " | 175 ngx_string("$remote_addr - $remote_user [$time_local] " |
176 "\"$request\" $status $body_bytes_sent " | 176 "\"$request\" $status $body_bytes_sent " |
177 "\"$http_referer\" \"$http_user_agent\""); | 177 "\"$http_referer\" \"$http_user_agent\""); |
178 | 178 |
179 | 179 |
180 static ngx_http_log_var_t ngx_http_log_vars[] = { | 180 static ngx_http_log_var_t ngx_http_log_vars[] = { |
181 { ngx_string("connection"), NGX_ATOMIC_T_LEN, ngx_http_log_connection }, | 181 { ngx_string("connection"), NGX_ATOMIC_T_LEN, ngx_http_log_connection }, |
182 { ngx_string("pipe"), 1, ngx_http_log_pipe }, | 182 { ngx_string("pipe"), 1, ngx_http_log_pipe }, |
183 { ngx_string("time_gmt"), sizeof("28/Sep/1970:12:00:00 +0600") - 1, | 183 { ngx_string("time_local"), sizeof("28/Sep/1970:12:00:00 +0600") - 1, |
184 ngx_http_log_time }, | 184 ngx_http_log_time }, |
185 { ngx_string("msec"), NGX_TIME_T_LEN + 4, ngx_http_log_msec }, | 185 { ngx_string("msec"), NGX_TIME_T_LEN + 4, ngx_http_log_msec }, |
186 { ngx_string("request_time"), NGX_TIME_T_LEN, ngx_http_log_request_time }, | 186 { ngx_string("request_time"), NGX_TIME_T_LEN, ngx_http_log_request_time }, |
187 { ngx_string("status"), 3, ngx_http_log_status }, | 187 { ngx_string("status"), 3, ngx_http_log_status }, |
188 { ngx_string("bytes_sent"), NGX_OFF_T_LEN, ngx_http_log_bytes_sent }, | 188 { ngx_string("bytes_sent"), NGX_OFF_T_LEN, ngx_http_log_bytes_sent }, |
1017 return NGX_CONF_ERROR; | 1017 return NGX_CONF_ERROR; |
1018 } | 1018 } |
1019 | 1019 |
1020 if (cf->args->nelts >= 3) { | 1020 if (cf->args->nelts >= 3) { |
1021 name = value[2]; | 1021 name = value[2]; |
1022 | |
1023 if (ngx_strcmp(name.data, "combined") == 0) { | |
1024 lmcf->combined_used = 1; | |
1025 } | |
1026 | |
1022 } else { | 1027 } else { |
1023 name.len = sizeof("combined") - 1; | 1028 name.len = sizeof("combined") - 1; |
1024 name.data = (u_char *) "combined"; | 1029 name.data = (u_char *) "combined"; |
1025 lmcf->combined_used = 1; | 1030 lmcf->combined_used = 1; |
1026 } | 1031 } |
1382 static ngx_int_t | 1387 static ngx_int_t |
1383 ngx_http_log_init(ngx_conf_t *cf) | 1388 ngx_http_log_init(ngx_conf_t *cf) |
1384 { | 1389 { |
1385 ngx_str_t *value; | 1390 ngx_str_t *value; |
1386 ngx_array_t a; | 1391 ngx_array_t a; |
1392 ngx_http_handler_pt *h; | |
1387 ngx_http_log_fmt_t *fmt; | 1393 ngx_http_log_fmt_t *fmt; |
1388 ngx_http_log_main_conf_t *lmcf; | 1394 ngx_http_log_main_conf_t *lmcf; |
1389 ngx_http_core_main_conf_t *cmcf; | 1395 ngx_http_core_main_conf_t *cmcf; |
1390 | 1396 |
1391 lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module); | 1397 lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module); |
1410 } | 1416 } |
1411 } | 1417 } |
1412 | 1418 |
1413 cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module); | 1419 cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module); |
1414 | 1420 |
1415 cmcf->log_handler = ngx_http_log_handler; | 1421 h = ngx_array_push(&cmcf->phases[NGX_HTTP_LOG_PHASE].handlers); |
1422 if (h == NULL) { | |
1423 return NGX_ERROR; | |
1424 } | |
1425 | |
1426 *h = ngx_http_log_handler; | |
1416 | 1427 |
1417 return NGX_OK; | 1428 return NGX_OK; |
1418 } | 1429 } |