From 2773cf3efee01ce6ededb5de4c5e274ebe3c8be4 Mon Sep 17 00:00:00 2001 From: Anuved Verma Date: Mon, 1 Jul 2024 15:36:24 -0700 Subject: [PATCH] add logging for error response header --- .../java/com/lyft/data/proxyserver/ProxyHandler.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyHandler.java b/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyHandler.java index b2b0ee62..ec20f0d8 100644 --- a/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyHandler.java +++ b/proxyserver/src/main/java/com/lyft/data/proxyserver/ProxyHandler.java @@ -67,12 +67,13 @@ protected void postConnectionHook( + " servlet path {} , toString {}", request.getRequestURL(), request.getRequestURI(), request.getServletPath(), request.toString(), var9); errorLogHeaders(request); + errorLogHeaders(response); callback.failed(var9); } } protected void errorLogHeaders(HttpServletRequest request) { - log.error("-------HttpServletRequest headers---------"); + log.error("------- error HttpServletRequest headers---------"); Enumeration headers = request.getHeaderNames(); while (headers.hasMoreElements()) { String header = headers.nextElement(); @@ -80,6 +81,14 @@ protected void errorLogHeaders(HttpServletRequest request) { } } + protected void errorLogHeaders(HttpServletResponse response) { + log.error("------- error HttpServletResponse headers---------"); + Collection headers = response.getHeaderNames(); + for (String header : headers) { + log.error(header + "->" + response.getHeader(header)); + } + } + protected void debugLogHeaders(HttpServletRequest request) { if (log.isDebugEnabled()) { log.debug("-------HttpServletRequest headers---------");