This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository

The following commit(s) were added to refs/heads/master by this push:
     new f1068d1  x-debug log-headers propagation and documentation
f1068d1 is described below

commit f1068d18733ae1551321d395a5bb591486d5abbd
Author: Aaron Canary <>
AuthorDate: Wed Feb 14 14:10:05 2018 -0600

    x-debug log-headers propagation and documentation
    Now the log-headers request will propagate upstream even when logging is 
not enabled on the local box. This makes it easier to use on higher tier caches.
    Also added documentation.
 doc/admin-guide/plugins/xdebug.en.rst | 6 ++++++
 plugins/xdebug/              | 6 +++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/doc/admin-guide/plugins/xdebug.en.rst 
index 45920af..32cc1df 100644
--- a/doc/admin-guide/plugins/xdebug.en.rst
+++ b/doc/admin-guide/plugins/xdebug.en.rst
@@ -54,6 +54,12 @@ Diags
     transaction specific diagnostics for the transaction. This also requires
     that :ts:cv:`proxy.config.diags.debug.enabled` is set to ``1``.
+    If the ``log-headers`` is requested while 
+    is set to ``xdebug.headers`` and :ts:cv:`proxy.config.diags.debug.enabled` 
is set to ``1``, 
+    then all client and server, request and response headers are logged. 
+    Also, the ``X-Debug: log-headers`` header is always added to the upstream 
     The ``X-Cache-Key`` header contains the URL that identifies the HTTP 
object in the
     Traffic Server cache. This header is particularly useful if a custom cache
diff --git a/plugins/xdebug/ b/plugins/xdebug/
index a4c0a62..7258a4d 100644
--- a/plugins/xdebug/
+++ b/plugins/xdebug/
@@ -320,6 +320,10 @@ InjectTxnUuidHeader(TSHttpTxn txn, TSMBuffer buffer, 
TSMLoc hdr)
 log_headers(TSHttpTxn txn, TSMBuffer bufp, TSMLoc hdr_loc, const char 
+  if (!TSIsDebugTagSet(DEBUG_TAG_LOG_HEADERS)) {
+    return;
+  }
   TSIOBuffer output_buffer;
   TSIOBufferReader reader;
   TSIOBufferBlock block;
@@ -458,7 +462,7 @@ XScanRequestHeaders(TSCont /* contp */, TSEvent event, void 
       } else if (header_field_eq("diags", value, vsize)) {
         // Enable diagnostics for DebugTxn()'s only
         TSHttpTxnDebugSet(txn, 1);
-      } else if (header_field_eq("log-headers", value, vsize) && 
+      } else if (header_field_eq("log-headers", value, vsize)) {
         xheaders |= XHEADER_X_DUMP_HEADERS;
         log_headers(txn, buffer, hdr, "ClientRequest");

To stop receiving notification emails like this one, please contact

Reply via email to