diff --git a/pom.xml b/pom.xml index 17eb1677..43b0e6fd 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ api jar ${project.groupId}:${project.artifactId} - 3.4.46 + 3.4.47 Hygieia Rest API Layer https://github.com/Hygieia/api @@ -59,7 +59,7 @@ - 3.15.43 + 3.15.44 4.2.18.RELEASE 8.5.70 1.9.4 diff --git a/src/main/java/com/capitalone/dashboard/logging/LoggingFilter.java b/src/main/java/com/capitalone/dashboard/logging/LoggingFilter.java index 0a7a299b..0e52fbc4 100644 --- a/src/main/java/com/capitalone/dashboard/logging/LoggingFilter.java +++ b/src/main/java/com/capitalone/dashboard/logging/LoggingFilter.java @@ -61,6 +61,8 @@ public class LoggingFilter implements Filter { private static final String API_USER_KEY = "apiUser"; + private static final String X_FORWARDED_FOR = "x-forwarded-for"; + private static final String UNKNOWN_USER = "unknown"; @@ -98,6 +100,8 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha try { requestLog.setClient(httpServletRequest.getRemoteAddr()); + String x_forwarded_for = bufferedRequest.getHeader(X_FORWARDED_FOR); + requestLog.setXForwardedFor(x_forwarded_for); requestLog.setEndpoint(httpServletRequest.getRequestURI()); requestLog.setMethod(httpServletRequest.getMethod()); requestLog.setParameter(requestMap.toString());