Repository: incubator-unomi Updated Branches: refs/heads/master 8f44f4be6 -> 989fc3670
improve debug logging for the action set remote host info Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/989fc367 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/989fc367 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/989fc367 Branch: refs/heads/master Commit: 989fc3670a5032abf7f7a7b8d3c19bfa179868df Parents: 8f44f4b Author: dgaillard <[email protected]> Authored: Tue Sep 4 18:56:22 2018 +0200 Committer: dgaillard <[email protected]> Committed: Tue Sep 4 18:56:22 2018 +0200 ---------------------------------------------------------------------- .../request/actions/SetRemoteHostInfoAction.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/989fc367/plugins/request/src/main/java/org/apache/unomi/plugins/request/actions/SetRemoteHostInfoAction.java ---------------------------------------------------------------------- diff --git a/plugins/request/src/main/java/org/apache/unomi/plugins/request/actions/SetRemoteHostInfoAction.java b/plugins/request/src/main/java/org/apache/unomi/plugins/request/actions/SetRemoteHostInfoAction.java index c3042e3..05687e8 100644 --- a/plugins/request/src/main/java/org/apache/unomi/plugins/request/actions/SetRemoteHostInfoAction.java +++ b/plugins/request/src/main/java/org/apache/unomi/plugins/request/actions/SetRemoteHostInfoAction.java @@ -106,8 +106,17 @@ public class SetRemoteHostInfoAction implements ActionExecutor { } String remoteAddr = httpServletRequest.getRemoteAddr(); + if (logger.isDebugEnabled()) { + logger.debug("Remote address is " + remoteAddr); + } String remoteAddrParameter = httpServletRequest.getParameter("remoteAddr"); + if (logger.isDebugEnabled()) { + logger.debug("Remote address param is " + remoteAddr); + } String xff = httpServletRequest.getHeader("X-Forwarded-For"); + if (logger.isDebugEnabled()) { + logger.debug("X-Forwarded-For is " + xff); + } if (remoteAddrParameter != null && remoteAddrParameter.length() > 0) { remoteAddr = remoteAddrParameter; } else if (xff != null && !xff.equals("")) { @@ -116,6 +125,9 @@ public class SetRemoteHostInfoAction implements ActionExecutor { } remoteAddr = xff; } + if (logger.isDebugEnabled()) { + logger.debug("Remote address used to localized is " + remoteAddr); + } try { if (isAValidIPAddress(remoteAddr)) {
