From: Willy Tarreau Date: Fri, 13 Jun 2014 10:21:40 +0000 (+0200) Subject: MINOR: log: allow the HTTP status code to be logged even in TCP frontends X-Git-Tag: v1.5.0~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4bf9963a78f568dac98cd4d2a5a590eb10f7030d;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/doc/configuration.txt b/doc/configuration.txt index 334adeda0a..c16137db50 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 efb3d2721c..392256f600 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 */