[master] d78f82d Provide short and long descriptions for the request response log records.

Martin Blix Grydeland martin at varnish-cache.org
Wed Oct 16 16:51:50 CEST 2013


commit d78f82ddc1484dcc81ed031816f73ec4d739d531
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Wed Oct 16 16:09:44 2013 +0200

    Provide short and long descriptions for the request response log records.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index b606f49..1ce24fa 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -98,7 +98,7 @@ enum sess_close {
 
 enum {
 	/* Fields from the first line of HTTP proto */
-#define SLTH(aa, bb)	bb,
+#define SLTH(tag, ind, req, resp, sdesc, ldesc)	ind,
 #include "tbl/vsl_tags_http.h"
 #undef SLTH
 };
diff --git a/include/tbl/vsl_tags.h b/include/tbl/vsl_tags.h
index 347e2ec..d33247e 100644
--- a/include/tbl/vsl_tags.h
+++ b/include/tbl/vsl_tags.h
@@ -121,23 +121,29 @@ SLTM(Length, "Size of object body", "")
 
 SLTM(FetchError, "Error while fetching object", "")
 
-#define SLTH(aa, bb)	SLTM(Req##aa, "", "")
+#define SLTH(tag, ind, req, resp, sdesc, ldesc) \
+	SLTM(Req##tag, (req ? "Client request " sdesc : "(unused)"), ldesc)
 #include "tbl/vsl_tags_http.h"
 #undef SLTH
 
-#define SLTH(aa, bb)	SLTM(Resp##aa, "", "")
+#define SLTH(tag, ind, req, resp, sdesc, ldesc) \
+	SLTM(Resp##tag, (resp ? "Client response " sdesc : "(unused)"), ldesc)
 #include "tbl/vsl_tags_http.h"
 #undef SLTH
 
-#define SLTH(aa, bb)	SLTM(Bereq##aa, "", "")
+#define SLTH(tag, ind, req, resp, sdesc, ldesc) \
+	SLTM(Bereq##tag, (req ? "Backend request " sdesc : "(unused)"), ldesc)
 #include "tbl/vsl_tags_http.h"
 #undef SLTH
 
-#define SLTH(aa, bb)	SLTM(Beresp##aa, "", "")
+#define SLTH(tag, ind, req, resp, sdesc, ldesc) \
+	SLTM(Beresp##tag, (resp ? "Backend response " sdesc : "(unused)"), \
+	    ldesc)
 #include "tbl/vsl_tags_http.h"
 #undef SLTH
 
-#define SLTH(aa, bb)	SLTM(Obj##aa, "", "")
+#define SLTH(tag, ind, req, resp, sdesc, ldesc) \
+	SLTM(Obj##tag, (resp ? "Object  " sdesc : "(unused)"), ldesc)
 #include "tbl/vsl_tags_http.h"
 #undef SLTH
 
diff --git a/include/tbl/vsl_tags_http.h b/include/tbl/vsl_tags_http.h
index f515492..55b98fc 100644
--- a/include/tbl/vsl_tags_http.h
+++ b/include/tbl/vsl_tags_http.h
@@ -30,12 +30,40 @@
  * The order of this table is not random, do not resort.
  * In particular, the FIRST and LOST entries must be last, in that order.
  *
+ * Arguments:
+ *	Tag-Name
+ *	struct http header index
+ *	1 if this header is used in requests
+ *	1 if this header is used in responses
+ *	short description postfix
+ *	long description (in RST "definition list" format)
+ *
  */
 
-SLTH(Method,	HTTP_HDR_METHOD)
-SLTH(URL,	HTTP_HDR_URL)
-SLTH(Protocol,	HTTP_HDR_PROTO)
-SLTH(Status,	HTTP_HDR_STATUS)
-SLTH(Response,	HTTP_HDR_RESPONSE)
-SLTH(Header,	HTTP_HDR_FIRST)
-SLTH(Lost,	HTTP_HDR_LOST)
+SLTH(Method,	HTTP_HDR_METHOD,	1, 0, "method",
+	"The HTTP request method used.\n\n"
+)
+SLTH(URL,	HTTP_HDR_URL,		1, 0, "URL",
+	"The HTTP request URL.\n\n"
+)
+SLTH(Protocol,	HTTP_HDR_PROTO,		1, 1, "protocol",
+	"The HTTP protocol version information.\n\n"
+)
+SLTH(Status,	HTTP_HDR_STATUS,	0, 1, "status",
+	"The HTTP status code received.\n\n"
+)
+SLTH(Response,	HTTP_HDR_RESPONSE,	0, 1, "response",
+	"The HTTP response string received.\n\n"
+)
+SLTH(Header,	HTTP_HDR_FIRST,		1, 1, "header",
+	"HTTP header contents.\n\n"
+	"The format is::\n\n"
+	"\t%s: %s\n"
+	"\t|   |\n"
+	"\t|   +- Header value\n"
+	"\t+----- Header name\n"
+	"\n"
+)
+SLTH(Lost,	HTTP_HDR_LOST,		1, 1, "(unused)",
+	""
+)



More information about the varnish-commit mailing list