From 81a78f9c8b5377ac603f447c0e0ce296a651330d Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Wed, 5 Mar 2014 11:22:23 +0000 Subject: [PATCH] Added query string to access log --- mongoose.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mongoose.c b/mongoose.c index c6a82966..585f3e0c 100644 --- a/mongoose.c +++ b/mongoose.c @@ -4404,11 +4404,12 @@ static void log_access(const struct connection *conn, const char *path) { flockfile(fp); mg_parse_header(mg_get_header(&conn->mg_conn, "Authorization"), "username", user, sizeof(user)); - fprintf(fp, "%s - %s [%s] \"%s %s HTTP/%s\" %d %" INT64_FMT, + fprintf(fp, "%s - %s [%s] \"%s %s%s%s HTTP/%s\" %d %" INT64_FMT, c->remote_ip, user[0] == '\0' ? "-" : user, date, c->request_method ? c->request_method : "-", - c->uri ? c->uri : "-", c->http_version, - c->status_code, conn->num_bytes_sent); + c->uri ? c->uri : "-", c->query_string ? "?" : "", + c->query_string ? c->query_string : "", + c->http_version, c->status_code, conn->num_bytes_sent); log_header(c, "Referer", fp); log_header(c, "User-Agent", fp); fputc('\n', fp);