From 10345663c8d7d011ae186fb22d5fdf9a1912b80d Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Tue, 2 Dec 2014 05:54:54 +0300 Subject: 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. --- src/http/ngx_http_request.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index f6ea6fb56..cffab9a69 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -595,4 +595,8 @@ extern ngx_http_header_out_t ngx_http_headers_out[]; } +#define ngx_http_set_log_request(log, r) \ + ((ngx_http_log_ctx_t *) log->data)->current_request = r + + #endif /* _NGX_HTTP_REQUEST_H_INCLUDED_ */ -- cgit