aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2014-12-02 05:54:54 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2014-12-02 05:54:54 +0300
commit10345663c8d7d011ae186fb22d5fdf9a1912b80d (patch)
treea50705318cf3dffcf9cd703e7e3f9898e22f8326 /src/http/ngx_http_request.c
parent778cc4b42ea85e19a8ebf6c1a42fc636e48ec309 (diff)
downloadnginx-10345663c8d7d011ae186fb22d5fdf9a1912b80d.tar.gz
nginx-10345663c8d7d011ae186fb22d5fdf9a1912b80d.zip
Upstream: improved subrequest logging.
To ensure proper logging make sure to set current_request in all event handlers, including resolve, ssl handshake, cache lock wait timer and aio read handlers. A macro ngx_http_set_log_request() introduced to simplify this.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 18c3b04e4..a07d5e47f 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -2169,13 +2169,11 @@ ngx_http_request_handler(ngx_event_t *ev)
{
ngx_connection_t *c;
ngx_http_request_t *r;
- ngx_http_log_ctx_t *ctx;
c = ev->data;
r = c->data;
- ctx = c->log->data;
- ctx->current_request = r;
+ ngx_http_set_log_request(c->log, r);
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http run request: \"%V?%V\"", &r->uri, &r->args);
@@ -2195,7 +2193,6 @@ void
ngx_http_run_posted_requests(ngx_connection_t *c)
{
ngx_http_request_t *r;
- ngx_http_log_ctx_t *ctx;
ngx_http_posted_request_t *pr;
for ( ;; ) {
@@ -2215,8 +2212,7 @@ ngx_http_run_posted_requests(ngx_connection_t *c)
r = pr->request;
- ctx = c->log->data;
- ctx->current_request = r;
+ ngx_http_set_log_request(c->log, r);
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http posted request: \"%V?%V\"", &r->uri, &r->args);