summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_request.c
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2022-07-28 11:05:04 +0800
committerZhidao HONG <z.hong@f5.com>2022-07-28 11:05:04 +0800
commit3f8cf62c03a55b9767f0c75b3df6a1a40252b19a (patch)
tree38c5c687bb348d888c5fb869d038cc21ea47c5f2 /src/nxt_http_request.c
parent8761501b4845656a0f2e5c0e7bf98f948c45fb5f (diff)
downloadunit-3f8cf62c03a55b9767f0c75b3df6a1a40252b19a.tar.gz
unit-3f8cf62c03a55b9767f0c75b3df6a1a40252b19a.tar.bz2
Log: customizable access log format.
Diffstat (limited to 'src/nxt_http_request.c')
-rw-r--r--src/nxt_http_request.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nxt_http_request.c b/src/nxt_http_request.c
index 5f8fd8f7..a16340de 100644
--- a/src/nxt_http_request.c
+++ b/src/nxt_http_request.c
@@ -791,6 +791,7 @@ 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_var_t *log_format;
nxt_http_proto_t proto;
nxt_http_request_t *r;
nxt_http_protocol_t protocol;
@@ -800,20 +801,22 @@ nxt_http_request_close_handler(nxt_task_t *task, void *obj, void *data)
r = obj;
proto.any = data;
- nxt_debug(task, "http request close handler");
-
conf = r->conf;
if (!r->logged) {
r->logged = 1;
access_log = conf->socket_conf->router_conf->access_log;
+ log_format = conf->socket_conf->router_conf->log_format;
if (access_log != NULL) {
- access_log->handler(task, r, access_log);
+ access_log->handler(task, r, access_log, log_format);
+ return;
}
}
+ nxt_debug(task, "http request close handler");
+
r->proto.any = NULL;
if (r->body != NULL && nxt_buf_is_file(r->body)