diff options
author | Tim van der Molen <tim@cvs.openbsd.org> | 2016-02-11 16:14:12 +0000 |
---|---|---|
committer | Tim van der Molen <tim@cvs.openbsd.org> | 2016-02-11 16:14:12 +0000 |
commit | 3bd4b5178ed6919db31bd4f8fd7e867a17ef7faf (patch) | |
tree | 334ef7dff5d0bd524bcc30b68ce47e063b9070b0 /usr.sbin | |
parent | c8f415f56ec08c1882b84869abd96ff384b0df47 (diff) |
Include the server port number in the common and combined logs. This is useful
to distinguish between http and https requests.
OK florian@ reyk@ a while ago
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/httpd/server_http.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/httpd/server_http.c b/usr.sbin/httpd/server_http.c index dfbcf7e7c42..ab0f6ff4d0a 100644 --- a/usr.sbin/httpd/server_http.c +++ b/usr.sbin/httpd/server_http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_http.c,v 1.103 2015/12/07 20:30:17 mmcc Exp $ */ +/* $OpenBSD: server_http.c,v 1.104 2016/02/11 16:14:11 tim Exp $ */ /* * Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org> @@ -1504,9 +1504,9 @@ server_log_http(struct client *clt, unsigned int code, size_t len) goto done; ret = evbuffer_add_printf(clt->clt_log, - "%s %s - %s [%s] \"%s %s%s%s%s%s\" %03d %zu\n", - srv_conf->name, ip, clt->clt_remote_user == NULL ? "-" : - user, tstamp, + "%s:%u %s - %s [%s] \"%s %s%s%s%s%s\" %03d %zu\n", + srv_conf->name, htons(srv_conf->port), ip, + clt->clt_remote_user == NULL ? "-" : user, tstamp, server_httpmethod_byid(desc->http_method), desc->http_path == NULL ? "" : path, desc->http_query == NULL ? "" : "?", @@ -1551,10 +1551,10 @@ server_log_http(struct client *clt, unsigned int code, size_t len) goto done; ret = evbuffer_add_printf(clt->clt_log, - "%s %s - %s [%s] \"%s %s%s%s%s%s\"" + "%s:%u %s - %s [%s] \"%s %s%s%s%s%s\"" " %03d %zu \"%s\" \"%s\"\n", - srv_conf->name, ip, clt->clt_remote_user == NULL ? "-" : - user, tstamp, + srv_conf->name, htons(srv_conf->port), ip, + clt->clt_remote_user == NULL ? "-" : user, tstamp, server_httpmethod_byid(desc->http_method), desc->http_path == NULL ? "" : path, desc->http_query == NULL ? "" : "?", |