diff options
author | Ruslan Ermilov <ru@nginx.com> | 2012-03-15 19:37:32 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2012-03-15 19:37:32 +0000 |
commit | 06733ae8cf9f376f0b707f9c83bc6412cdf3faab (patch) | |
tree | d841190c900179d093f2f00130a1f7be495a3ba2 | |
parent | d694ff7798bf0da11b01a950fbce13b5cab00c8e (diff) | |
download | nginx-06733ae8cf9f376f0b707f9c83bc6412cdf3faab.tar.gz nginx-06733ae8cf9f376f0b707f9c83bc6412cdf3faab.zip |
- New variable: $connection_requests.
- While here, fixed format specifier for $connection.
-rw-r--r-- | src/http/modules/ngx_http_log_module.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c index 2452f23b3..2d412853b 100644 --- a/src/http/modules/ngx_http_log_module.c +++ b/src/http/modules/ngx_http_log_module.c @@ -80,6 +80,8 @@ static ssize_t ngx_http_log_script_write(ngx_http_request_t *r, static u_char *ngx_http_log_connection(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op); +static u_char *ngx_http_log_connection_requests(ngx_http_request_t *r, + u_char *buf, ngx_http_log_op_t *op); static u_char *ngx_http_log_pipe(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op); static u_char *ngx_http_log_time(ngx_http_request_t *r, u_char *buf, @@ -193,6 +195,8 @@ static ngx_str_t ngx_http_combined_fmt = static ngx_http_log_var_t ngx_http_log_vars[] = { { ngx_string("connection"), NGX_ATOMIC_T_LEN, ngx_http_log_connection }, + { ngx_string("connection_requests"), NGX_INT_T_LEN, + ngx_http_log_connection_requests }, { 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 }, @@ -501,7 +505,15 @@ static u_char * ngx_http_log_connection(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op) { - return ngx_sprintf(buf, "%ui", r->connection->number); + return ngx_sprintf(buf, "%uA", r->connection->number); +} + + +static u_char * +ngx_http_log_connection_requests(ngx_http_request_t *r, u_char *buf, + ngx_http_log_op_t *op) +{ + return ngx_sprintf(buf, "%ui", r->connection->requests); } |