summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_request.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-04-11 18:23:33 +0300
committerValentin Bartenev <vbart@nginx.com>2018-04-11 18:23:33 +0300
commit204c39472166440f54435edcef8d286f429e0aae (patch)
tree25fb74d5a547bc96c72d1f8a70d434d3cbdedc75 /src/nxt_http_request.c
parentc7e575d5c61c2b301207c751ae73186d7568857e (diff)
downloadunit-204c39472166440f54435edcef8d286f429e0aae.tar.gz
unit-204c39472166440f54435edcef8d286f429e0aae.tar.bz2
Initial access log support.
Diffstat (limited to 'src/nxt_http_request.c')
-rw-r--r--src/nxt_http_request.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index b1d52dd5..02075b19 100644
--- a/src/nxt_http_request.c
+++ b/src/nxt_http_request.c
@@ -442,9 +442,10 @@ nxt_http_request_error_handler(nxt_task_t *task, void *obj, void *data)
void
nxt_http_request_close_handler(nxt_task_t *task, void *obj, void *data)
{
- nxt_http_proto_t proto;
- nxt_http_request_t *r;
- nxt_http_proto_close_t handler;
+ nxt_http_proto_t proto;
+ nxt_http_request_t *r;
+ nxt_http_proto_close_t handler;
+ nxt_router_access_log_t *access_log;
r = obj;
proto.any = data;
@@ -453,11 +454,12 @@ nxt_http_request_close_handler(nxt_task_t *task, void *obj, void *data)
if (!r->logged) {
r->logged = 1;
- // STUB
- nxt_debug(task, "http request log: \"%*s \"%V %V %V\" %d\"",
- (size_t) r->remote->address_length,
- nxt_sockaddr_address(r->remote),
- r->method, &r->target, &r->version, r->status);
+
+ access_log = r->socket_conf->router_conf->access_log;
+
+ if (access_log != NULL) {
+ access_log->handler(task, r, access_log);
+ }
}
handler = nxt_http_proto_close[r->protocol];