Mercurial > hg > nginx
diff src/http/modules/ngx_http_log_module.c @ 3873:eae4a59ae59a
$time_iso8601 log variable
patch by Michael Lustfield
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 16 Mar 2011 15:46:57 +0000 |
parents | dd1570b6f237 |
children | 509db6c0c5dc 17ab1927f80f |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_log_module.c Wed Mar 16 15:32:31 2011 +0000 +++ b/src/http/modules/ngx_http_log_module.c Wed Mar 16 15:46:57 2011 +0000 @@ -83,6 +83,8 @@ ngx_http_log_op_t *op); static u_char *ngx_http_log_time(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op); +static u_char *ngx_http_log_iso8601(ngx_http_request_t *r, u_char *buf, + ngx_http_log_op_t *op); static u_char *ngx_http_log_msec(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op); static u_char *ngx_http_log_request_time(ngx_http_request_t *r, u_char *buf, @@ -193,6 +195,8 @@ { ngx_string("pipe"), 1, ngx_http_log_pipe }, { ngx_string("time_local"), sizeof("28/Sep/1970:12:00:00 +0600") - 1, ngx_http_log_time }, + { ngx_string("time_iso8601"), sizeof("1970-09-28T12:00:00+06:00") - 1, + ngx_http_log_iso8601 }, { ngx_string("msec"), NGX_TIME_T_LEN + 4, ngx_http_log_msec }, { ngx_string("request_time"), NGX_TIME_T_LEN + 4, ngx_http_log_request_time }, @@ -510,6 +514,12 @@ ngx_cached_http_log_time.len); } +static u_char * +ngx_http_log_iso8601(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op) +{ + return ngx_cpymem(buf, ngx_cached_http_log_iso8601.data, + ngx_cached_http_log_iso8601.len); +} static u_char * ngx_http_log_msec(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)