comparison src/http/modules/ngx_http_log_module.c @ 616:8214eaef3530 NGINX_0_9_6

nginx 0.9.6 *) Feature: the "map" directive supports regular expressions as value of the first parameter. *) Feature: $time_iso8601 access_log variable. Thanks to Michael Lustfield.
author Igor Sysoev <http://sysoev.ru>
date Mon, 21 Mar 2011 00:00:00 +0300
parents 8246d8a2c2be
children 23ef0645ea57
comparison
equal deleted inserted replaced
615:02221dcea723 616:8214eaef3530
80 static u_char *ngx_http_log_connection(ngx_http_request_t *r, u_char *buf, 80 static u_char *ngx_http_log_connection(ngx_http_request_t *r, u_char *buf,
81 ngx_http_log_op_t *op); 81 ngx_http_log_op_t *op);
82 static u_char *ngx_http_log_pipe(ngx_http_request_t *r, u_char *buf, 82 static u_char *ngx_http_log_pipe(ngx_http_request_t *r, u_char *buf,
83 ngx_http_log_op_t *op); 83 ngx_http_log_op_t *op);
84 static u_char *ngx_http_log_time(ngx_http_request_t *r, u_char *buf, 84 static u_char *ngx_http_log_time(ngx_http_request_t *r, u_char *buf,
85 ngx_http_log_op_t *op);
86 static u_char *ngx_http_log_iso8601(ngx_http_request_t *r, u_char *buf,
85 ngx_http_log_op_t *op); 87 ngx_http_log_op_t *op);
86 static u_char *ngx_http_log_msec(ngx_http_request_t *r, u_char *buf, 88 static u_char *ngx_http_log_msec(ngx_http_request_t *r, u_char *buf,
87 ngx_http_log_op_t *op); 89 ngx_http_log_op_t *op);
88 static u_char *ngx_http_log_request_time(ngx_http_request_t *r, u_char *buf, 90 static u_char *ngx_http_log_request_time(ngx_http_request_t *r, u_char *buf,
89 ngx_http_log_op_t *op); 91 ngx_http_log_op_t *op);
191 static ngx_http_log_var_t ngx_http_log_vars[] = { 193 static ngx_http_log_var_t ngx_http_log_vars[] = {
192 { ngx_string("connection"), NGX_ATOMIC_T_LEN, ngx_http_log_connection }, 194 { ngx_string("connection"), NGX_ATOMIC_T_LEN, ngx_http_log_connection },
193 { ngx_string("pipe"), 1, ngx_http_log_pipe }, 195 { ngx_string("pipe"), 1, ngx_http_log_pipe },
194 { ngx_string("time_local"), sizeof("28/Sep/1970:12:00:00 +0600") - 1, 196 { ngx_string("time_local"), sizeof("28/Sep/1970:12:00:00 +0600") - 1,
195 ngx_http_log_time }, 197 ngx_http_log_time },
198 { ngx_string("time_iso8601"), sizeof("1970-09-28T12:00:00+06:00") - 1,
199 ngx_http_log_iso8601 },
196 { ngx_string("msec"), NGX_TIME_T_LEN + 4, ngx_http_log_msec }, 200 { ngx_string("msec"), NGX_TIME_T_LEN + 4, ngx_http_log_msec },
197 { ngx_string("request_time"), NGX_TIME_T_LEN + 4, 201 { ngx_string("request_time"), NGX_TIME_T_LEN + 4,
198 ngx_http_log_request_time }, 202 ngx_http_log_request_time },
199 { ngx_string("status"), 3, ngx_http_log_status }, 203 { ngx_string("status"), 3, ngx_http_log_status },
200 { ngx_string("bytes_sent"), NGX_OFF_T_LEN, ngx_http_log_bytes_sent }, 204 { ngx_string("bytes_sent"), NGX_OFF_T_LEN, ngx_http_log_bytes_sent },
508 { 512 {
509 return ngx_cpymem(buf, ngx_cached_http_log_time.data, 513 return ngx_cpymem(buf, ngx_cached_http_log_time.data,
510 ngx_cached_http_log_time.len); 514 ngx_cached_http_log_time.len);
511 } 515 }
512 516
517 static u_char *
518 ngx_http_log_iso8601(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
519 {
520 return ngx_cpymem(buf, ngx_cached_http_log_iso8601.data,
521 ngx_cached_http_log_iso8601.len);
522 }
513 523
514 static u_char * 524 static u_char *
515 ngx_http_log_msec(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op) 525 ngx_http_log_msec(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
516 { 526 {
517 ngx_time_t *tp; 527 ngx_time_t *tp;