From 4bf9963a78f568dac98cd4d2a5a590eb10f7030d Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 13 Jun 2014 12:21:40 +0200 Subject: [PATCH] MINOR: log: allow the HTTP status code to be logged even in TCP frontends Log format is defined in the frontend, and some frontends may be chained to an HTTP backend. Sometimes it's very convenient to be able to log the HTTP status code of these HTTP backends. This status is definitely present in the internal structures, it's just that we used to limit it to be used in HTTP frontends. So let's simply relax the check to allow it to be used in TCP frontends as well. --- doc/configuration.txt | 2 +- src/log.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 334adeda0..c16137db5 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -12076,7 +12076,7 @@ Please refer to the table below for currently defined variables : | H | %CS | captured_response_cookie | string | | | %H | hostname | string | | | %ID | unique-id | string | - | H | %ST | status_code | numeric | + | | %ST | status_code | numeric | | | %T | gmt_date_time | date | | | %Tc | Tc | numeric | | | %Tl | local_date_time | date | diff --git a/src/log.c b/src/log.c index efb3d2721..392256f60 100644 --- a/src/log.c +++ b/src/log.c @@ -80,7 +80,7 @@ static const struct logformat_type logformat_keywords[] = { { "CS", LOG_FMT_CSERVER, PR_MODE_HTTP, LW_RSPHDR, NULL }, /* server cookie */ { "H", LOG_FMT_HOSTNAME, PR_MODE_TCP, LW_INIT, NULL }, /* Hostname */ { "ID", LOG_FMT_UNIQUEID, PR_MODE_HTTP, LW_BYTES, NULL }, /* Unique ID */ - { "ST", LOG_FMT_STATUS, PR_MODE_HTTP, LW_RESP, NULL }, /* status code */ + { "ST", LOG_FMT_STATUS, PR_MODE_TCP, LW_RESP, NULL }, /* status code */ { "T", LOG_FMT_DATEGMT, PR_MODE_TCP, LW_INIT, NULL }, /* date GMT */ { "Tc", LOG_FMT_TC, PR_MODE_TCP, LW_BYTES, NULL }, /* Tc */ { "Tl", LOG_FMT_DATELOCAL, PR_MODE_TCP, LW_INIT, NULL }, /* date local timezone */